I wasn’t going to answer that question rsrs, but...
Come on you want something nice to play ? or something professional ?
Professional - There is nowhere to run, you will have to work with neural networks, this demands a well-honed Artificial Intelligence, everything is segmented, word for word, each one receives a certain grammatical classification (verb, adjective, nouns, pronouns, etc), this will separate your entire sentence into grammatical categories, later this will be used to compose the context as a whole, it is really something complex...
child’s play - At the beginning of the Internet the existing searchers at the end of the 90’s did not possess IA
to interpret a phrase typed in the search, but then how it was done? - Levenshtein is the answer, a widely used algorithm for finding next/similar words, for example if a person typed "abacachi" how would we know he meant "pineapple"? Levenshtein does this, he calculates the minimum distance between two words, imagine in his example:
"Vai chover amanhã?"
"Vou precisar de uma guarda chuva amanhã?"
Imagine that in your system you only have a basis by knowing the word chuva
, temperatura
and clima
that is just three words to define an action for weather forecast, as those three words in your little bank would understand those phrases of yours ?
A: Segment all words and apply Levenshtein’s algorithm to each word, in the first sentence you will get a great word score chover
when compared to the word of your bank chuva
, That is, the word rain will stand out as the best punctuation in relation to the other words of the phrase, it gives you clues that your phrase may have to do with the mood and you could take an action depending on the scores of the other words of that phrase. The same happens for the next sentence that will have a distance equal to 0
returned by the algorithm of course the two words are equal...
See the expected results for Levenshtein for his first sentence:
chuva => vai = distancia de 4
chuva => chover = distancia de 3
chuva => amanhã = distancia de 6
Shortest distance is the word chover
is an excellent score for a word with 6 characters, note the word vai
the word only has 3 characters but has distance of 4, we can say that it is completely different from the word rain and has to be discarded even right away, gave to get the idea of how everything works/ worked, this algorithm is still very used ...
Cool project, google uses artificial intelligence and language processing to trace the meaning composed by the words in a sentence, is an arduous path you will need to train a database, remembering that your
if
demonstrated this comparing audio with a rsrs phrase, you know that’s not quite how it works right ? when capturing an audio usually you will have to transcribe it in text before, very complex subject for a mere comment lol– ederwander
Yes, I understand it is not a basic subject. In question I simplified for practical purposes. What I have today, already transforms my audio into text, processes through the if’s, generates a text that is transformed into audio and is played. The core of my doubt was how to remove the plethora of if’s conditions that such a project would have, for a more efficient approach.
– Denis Callau