Answer the question
In order to leave comments, you need to log in
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
Atr I rzh with sun and in tki htite brd will limit?
By the way, you will restore this phrase
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
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.
With what help it can be implemented?permutation tokens + regex.
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.
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 questionAsk a Question
731 491 924 answers to any question