K
K
kolya2_romanov2020-11-06 13:33:09
Python
kolya2_romanov, 2020-11-06 13:33:09

How to write a delirium detector in Python?

I want me to pass somewhere a string like "asdasfgasgfasgfasgas" or "lololololol)))" and the program calculates whether it's nonsense or not. That is, so that she reacts to "French buns", for example, not as nonsense, but to "lelelell" as nonsense. How can this be realized?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
V
Vladimir Korotenko, 2020-11-06
@firedragon

Atr I rzh with sun and in tki htite brd will limit?
By the way, you will restore this phrase

A
Antonio Solo, 2020-11-06
@solotony

option 1 - create a dictionary and check the presence of the entered words in the dictionary (corrected for morphology and errors)
option 2 - make a neural network and train it. here you can teach both morphology (that is, to catch afasfasfsd) and "meanings" (that is, to catch "The match in the library works") - the second case is more difficult, but realizable.
the neural network option does not exclude pre-processing with a dictionary, morphology, errors

A
Armenian Radio, 2020-11-07
@gbg

The minimal delirium detector is a word device analyzer for a number of formal features
1) Natural language words do not contain numbers
2) Words do not contain more than two consecutive letters
3) Most words do not contain more than two consonants in a row or more than two vowels. Exceptions can be placed in a dictionary
4) Most words do not contain cyclic repetitions of character groups.

X
xmoonlight, 2020-11-06
@xmoonlight

With what help it can be implemented?
permutation tokens + regex.

N
newvasyuki, 2020-11-07
@newvasyuki

The task is clearly for machine learning and neural networks. Classification task, supervised learning. Similar to the spam/non-spam detection task (ham). Try it, it might work.

V
Vladimir Seregin, 2020-12-04
@Heavis

I agree with the comments, the answer depends on the context and the definition of the words "nonsense" and "meaning".
But in your examples (

"asdasfgasgfasgfasgas" или "лололололол)))" VS "Французские булочки"
) spell checker will do. For example, https://pypi.org/project/pyspellchecker/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question