Pull to refresh
330.35

Python *

Interpreted high-level programming language for general-purpose programming

Show first
Rating limit
Level of difficulty

Blinking into Morse code

Level of difficulty Easy
Reading time 10 min
Views 313
Python *IT Infrastructure *Data Engineering *
Sandbox

Explaining main algorithm.

For a while I’ve been thinking of writing a scientific article. I wanted it to have certain utility.

Morse code is binary: it takes only two values – either dot (short) or hyphen (long). I figured out that short (s) can stand for two-eye blinking whilst long (l) can indicate left-eye blinking. Another question emerged: how to understand when does one-symbol recording stop?

Empty space between two symbols can be presented by right-eye blinking – r. If I input singly symbol of short (dot) and long (hyphen), I will blink my right eye once to indicate the space between two symbols.

To separate independent words, one has to blink her right eye twice and get rr.

Hence, I have collected an ordered set of symbols – r, l, s, - that can be converted into a full-fledged text. Once I accomplish the transformation, I get an answer.

Read more
Total votes 6: ↑6 and ↓0 +6
Comments 2

On the difference between regular functions and Lambdas

Level of difficulty Medium
Reading time 11 min
Views 1.3K
Python *Java *C++ *Assembler *

The point of this article is to explore Lambda functions, their dirrerences from regular functions and how they are implemented, based on C++, Python and Java programming languages.

Throughout this article I will be using godbolt.org to compile code and see machine code or byte code.

Read more
Total votes 2: ↑2 and ↓0 +2
Comments 2

The Collatz conjecture is the greatest math trick of all time

Reading time 4 min
Views 1.8K
Entertaining tasks Python *Mathematics *Popular science

On the Internet and in non-fiction literature you can often find various mathematical tricks. The Collatz conjecture leaves all such tricks behind. At first glance, it may seem like some kind of a trick with a catch. However, there is no catch. You think of a number and repeat one of two arithmetic operations for it several times. Surprisingly, the result of these actions will always be the same. Or, may be not always?

Read more
Total votes 7: ↑7 and ↓0 +7
Comments 2

Writing The Matrix in Python: easy guide

Reading time 6 min
Views 1.7K
Python *Programming *Studying in IT

Programming textbooks usually do not indulge us with variety of examples. In most manuals, exercises are similar to each other and not particularly interesting: create another address book, draw a circle using turtle, develop a website for a store selling some kind of "necessary" advertising nonsense. Too far from the authentic imitation of "The Matrix". Although…

How about taking over the control and starting to invent exercises yourself?

Would you like to write your own personal little "Matrix"? Of course, not the one with skyscrapers, stylish phones of the time, and the ubiquitous invincible Agent Smiths. We will need a couple of more months of learning for that. But any beginner programmer can write a model of the cult splash screensaver with the green streams of digits flowing down the screen. Let's try to creat it in the "great and mighty" Python.

Read more
Total votes 11: ↑10 and ↓1 +9
Comments 0

Use of Python to write plugins for GIMP

Level of difficulty Medium
Reading time 9 min
Views 979
Python *
Sandbox

GIMP (GNU Image Manipulation Program) is a free and open-source image editing software that provides users with a wide range of tools for editing and manipulating digital images. Python is a high-level programming language that is often used for scripting and automation tasks. The combination of GIMP and Python provides a powerful platform for users to create custom image editing plugins that can automate repetitive tasks, extend the functionality of GIMP, and customize the software to suit their specific needs.

Python provides a flexible and easy-to-learn language for writing GIMP plugins. GIMP provides an API (Application Programming Interface) that allows Python scripts to interact with the image editing program Python plugins for GIMP can be used for a wide range of tasks, including automating repetitive tasks, enhancing the functionality of GIMP, and customizing the software to suit specific needs. Some examples of tasks that can be automated using Python plugins include batch processing of images, resizing and cropping of images, and converting file formats.

Plugins can also add new features to GIMP, such as custom brushes, filters, and effects. Additionally, plugins can be used to create custom user interfaces that enable users to interact with GIMP in new and unique ways.

Read more
Total votes 1: ↑1 and ↓0 +1
Comments 0

Data Phoenix Digest — ISSUE 2.2023

Reading time 2 min
Views 696
Python *Big Data *Machine learning *DevOps *Artificial Intelligence
Digest

Video recording of our webinar about dstack and reproducible ML workflows, AVL binary tree operations, Ultralytics YOLOv8, training XGBoost, productionize ML models, introduction to forecasting ensembles, domain expansion of image generators, Muse, X-Decoder, Box2Mask, RoDynRF, AgileAvatar and more.

Read more
Total votes 1: ↑1 and ↓0 +1
Comments 0

Building a GPT-like Model from Scratch with Detailed Theory and Code Implementation

Reading time 14 min
Views 18K
Open Data Science corporate blog Python *Machine learning *Artificial Intelligence Natural Language Processing *
Tutorial

Unlock the power of Transformer Neural Networks and learn how to build your own GPT-like model from scratch. In this in-depth guide, we will delve into the theory and provide a step-by-step code implementation to help you create your own miniGPT model. The final code is only 400 lines and works on both CPUs as well as on the GPUs. If you want to jump straight to the implementation here is the GitHub repo.

Transformers are revolutionizing the world of artificial intelligence. This simple, but very powerful neural network architecture, introduced in 2017, has quickly become the go-to choice for natural language processing, generative AI, and more. With the help of transformers, we've seen the creation of cutting-edge AI products like BERT, GPT-x, DALL-E, and AlphaFold, which are changing the way we interact with language and solve complex problems like protein folding. And the exciting possibilities don't stop there - transformers are also making waves in the field of computer vision with the advent of Vision Transformers.

Read more
Total votes 25: ↑25 and ↓0 +25
Comments 0

Asymmetric horizontal distribution for time series

Reading time 4 min
Views 1.2K
Python *
Sandbox

The goal of paper is to demonstrate non-trivial approaches to give statistical estimate for forecast result. Idea comes from probability cone concept. A probability cone is an indicator that forecasts a statistical distribution from a set point in time into the future. This acticle provide alternative approaches using machine learning, regression analysis.

Read more
Rating 0
Comments 0

InvokeAI 2.2: UI Outpainting, Embedding Management and more

Reading time 2 min
Views 4.9K
Python *Image processing *Machine learning *Graphic design *Artificial Intelligence

InvokeAI 2.2 is now available to everyone. This update brings in exciting features, like UI Outpainting, Embedding Management and more. See highlighted updates below, or the full release notes for everything included in the release.

What’s new?
Total votes 5: ↑5 and ↓0 +5
Comments 2

Python Junior Plus, or the beginner's Roadmap to becoming a Python programmer

Reading time 8 min
Views 4.8K
Python *Programming *IT career

image


Hello! My name is Mikhail Emelyanov, I am embedded software engineer, and I was inspired to write this little roadmap on the capabilities of Python language by a certain commonality among the existing Python tutorials found on the web.


The usual suggestions to study, say, “Algorithms and Data Structures” or “Databases” are especially jarring. You can spend years studying these topics, and even after decades you'd still be able to find something you didn't know yet even without ever venturing outside the scope of Algorithms!


Using video game analogies, we can say that novice programmers often stand on the shore of the lake of boiling lava with an island with the ever-coveted jobs in the center, while the islands in between, which you have to jump on, gradually increasing your skills in successive mini-quests, are either missing, or arranged haphazardly, or their fairly smooth sequence breaks off, never having managed to get you any farther from the shore. Let's try to build a path of hint islands, a number of which, although not without effort, will finally allow us to reach our goal.

Read more →
Rating 0
Comments 3

I trained a neural network on my drawings and give the model for free (and teach you to create your own)

Reading time 2 min
Views 2.4K
Python *Image processing *Machine learning *Graphic design *Artificial Intelligence
Tutorial

Great for seamless patterns, abstract drawings, and watercolor-styled images. How to use it and train a neural network on your own pictures?

Download the model here: https://huggingface.co/netsvetaev/netsvetaev-free

I wanna know!
Total votes 6: ↑6 and ↓0 +6
Comments 0

Detecting attempts of mass influencing via social networks using NLP. Part 2

Reading time 3 min
Views 875
Python *Data Mining *Twitter API *Big Data *Natural Language Processing *
Tutorial

In Part 1 of this article, I built and compared two classifiers to detect trolls on Twitter. You can check it out here.

Now, time has come to look more deeply into the datasets to find some patterns using exploratory data analysis and topic modelling.

EDA

To do just that, I first created a word cloud of the most common words, which you can see below.

Read more
Total votes 3: ↑3 and ↓0 +3
Comments 0

Detecting attempts of mass influencing via social networks using NLP. Part 1

Reading time 5 min
Views 1.3K
Python *Data Mining *Twitter API *Big Data *Natural Language Processing *
Tutorial

During the last decades, the world’s population has been developing as an information society, which means that information started to play a substantial end-to-end role in all life aspects and processes. In view of the growing demand for a free flow of information, social networks have become a force to be reckoned with. The ways of war-waging have also changed: instead of conventional weapons, governments now use political warfare, including fake news, a type of propaganda aimed at deliberate disinformation or hoaxes. And the lack of content control mechanisms makes it easy to spread any information as long as people believe in it.  

Based on this premise, I’ve decided to experiment with different NLP approaches and build a classifier that could be used to detect either bots or fake content generated by trolls on Twitter in order to influence people. 

In this first part of the article, I will cover the data collection process, preprocessing, feature extraction, classification itself and the evaluation of the models’ performance. In Part 2, I will dive deeper into the troll problem, conduct exploratory analysis to find patterns in the trolls’ behaviour and define the topics that seemed of great interest to them back in 2016.

Features for analysis

From all possible data to use (like hashtags, account language, tweet text, URLs, external links or references, tweet date and time), I settled upon English tweet text, Russian tweet text and hashtags. Tweet text is the main feature for analysis because it contains almost all essential characteristics that are typical for trolling activities in general, such as abuse, rudeness, external resources references, provocations and bullying. Hashtags were chosen as another source of textual information as they represent the central message of a tweet in one or two words. 

Read more
Total votes 3: ↑3 and ↓0 +3
Comments 0

How we tackled document recognition issues for autonomus and automatic payments using OCR and NER

Reading time 5 min
Views 783
Python *Natural Language Processing *
Sandbox

In this article, I would like to describe how we’ve tackled the named entity recognition (aka NER) issue at Sber with the help of advanced AI techniques. It is one of many natural language processing (NLP) tasks that allows you to automatically extract data from unstructured text. This includes monetary values, dates, or names, surnames and positions.

Just imagine countless textual documents even a medium-sized organisation deals with on a daily basis, let alone huge corporations. Take Sber, for example: it is the largest financial institution in Russia, Central and Eastern Europe that has about 16,500 offices with over 250,000 employees, 137 million retail and 1.1 million corporate clients in 22 countries. As you can imagine, with such an enormous scale, the company collaborates with hundreds of suppliers, contractors and other counterparties, which implies thousands of contracts. For instance, the estimated number of legal documents to be processed in 2022 has been over 65,000, each of them consisting of 30 pages on average. During the lifecycle of a contract, a contract usually updated with 3 to 5 additional agreements. On top of this, a contract is accompanied by various source documents describing transactions. And in the PDF format, too.

Previously, the processing duty befell our service centre’s employees who checked whether payment details in a bill match those in the contract and then sent the document to the Accounting Department where an accountant double-checked everything. This is quite a long journey to a payment, right?

Read more
Rating 0
Comments 0

Authors' contribution