Answer the question
In order to leave comments, you need to log in
A bot that understands the meaning?
I am writing myself a bot to answer questions on a pre-specified short narrative text.
This is my personal research and an attempt to create something that works properly (and not a semi-finished product!).
What is the easiest way to achieve understanding of phrases by a bot and their competent construction/formation when it responds to user phrases?
Just a short procedure for decomposing the text into entities with their semantic relationships.
Or the mechanism of creation of rules.
The main thing:
1. Without using third-party libs.
2. Without using training data.
If anyone had experience in developing something like this, I will be glad for any brief but correct directions and approaches.
In advance, Thanks everyone !
Answer the question
In order to leave comments, you need to log in
If the approach is "head-on", then do a search in the sent message according to the words, issue ready-made clarifying questions, for example:
- I want to buy a Pokemon, how much will the delivery cost?
Keywords: buy, pokemon, how much, cost, delivery A pokemon
is a thing in the catalog, so you can show options for pokemon.
Delivery is an action, so you can show the cost.
We issue options with the buttons:
- Select a pokemon
- Delivery cost
If more correctly, then google world2vec, then the trained bot will already understand the context, because the example above is the simplest.
Problem 1 your bot will not understand the narrative until it learns to understand its meaning, i.e. highlight onecontext out of millions that you or another person can interpret as correct .
Problem 2 your friend sitting next to you will say that the bot is stupid because to your question, the bot answered nonsense, which is understandable only to you, but not to your friend.
Problem 3 is to get a response from the bot that is equally clear to you and a friend.
I sketched it, see how it works
The world around us and other people drive us into frames:
- don’t go
there - don’t touch here
- where you were born, it came in handy there
- it’s not the sun, but the moon
- the grass is green, not brown
- and so on .d. millions of contexts
Each context is a vector, a piece of our experience, the whole set of contexts defines your personality .
In order for you to be on the same wavelength with the bot, you must have vectors similar to it. Those. you need to create an environment for the bot to experience the same limitations as most of the people around you.
Try to explain to some person from an ancient African tribe that there are people - this is not good, he will not understand you, because. he grew up in a different environment, with completely different frames and foundations.
Creating such a bot is the same as raising a child, i.e. difficult, but quite possible.
Start with this videoto understand what I mean when I say "create an environment".
You can start by building a semantic network by text.
After the network is built. The task of the bot is to find vertices and edges in this network.
Vertices and edges will essentially be the answer to the question.
I have never dealt with bots. But I understood how RDF/Semantic web/GraphQl works.
But this is all from the realm of clear logic. From what died in the 80s along with Prolog and Lisp.
Perhaps modern bots are built somehow differently. Based on fuzzy (analog or real
concepts). For example, if Sasha loves Masha, then from the point of view of fuzzy logic, this is not a fact,
but simply a value slightly less than one. Assumption. And if there are many facts in the text
manifestations of love from Sasha, then in this case this fuzzy connection will grow and strengthen
according to a certain function with saturation, but it will never reach one, and just remain
an assumption. Here, too, to the heap of the mechanics of neural networks.
Although KMK NS are poorly suited for text tasks. They have a large memory limit. The network
summarizes the facts well. But he does not remember particular cases well.
semantics cannot be obtained through syntax (only partially, at the level of object-property and object-action relations)
the text does not contain the whole meaning of the statement, there is an implied, implicit
context is completed on the basis of its own model of the world
and this is a naive model (a cup is on the table , the fork lies, the water is wet, the earth is flat, etc.)
its construction is impossible without the implementation / imitation of all 5 human channels of perception
as a result - we build a model of each participant, the text as the impact of models on each other
at a primitive level - is implemented by semantic frames
Duck what are you, hardcode in OOP. Make a tree of biological semantics (species, genus, order, class). To parse things like "he ate her family with his own eyes"
Then build trees across all objects using inheritance. To have a table / chair and other things.
And then yes, what meaning exactly you will lay in each word. For example, what is happiness? You can spend a lot of time talking about this word. And you can give a clear definition, for example, "a temporary state when the desire has come true (the goal has been achieved)." And all this in the meta-language you invented)
Attach all possible word forms to each word, including spelling with errors.
Then do the processing of sentences, pull out all possible variants of meanings.
Add context, i.e. create a personality for bots. Smear this business with psychological pleasures (classifications of personalities from various studies).
According to the previous two points, the weights of these meanings can be attached to the options.
Most importantly, the bot must have a goal. It's just that communication won't work. Here, for example, to make a psychological portrait of another participant is the goal. Under it, you need to ask some questions. At the same time, hanging psychology (this is the same model, simplified basic rules), it turns out that the questions must also be answered by the bot, in a way that makes it possible to ask more personal questions. Well, I don't know what your goal is. Find a problem with a person and offer an opportunity to solve it by taking a commission, well, it would be nice)
Just a short procedure for decomposing the text into entities with their semantic relationships.
First, you need to parse the text into subjects, predicates, and other parts of sentences. And here the problems already begin: is "crocodile" a subject or a predicate of the past kind?
Further difficulties will follow. For example, in the text, m.b. something like
Your bot must understand the speech of the characters - and take into account that the characters can lie.
Vasya said:
- There was a blue ball.
Petya objected:
- No, the ball was red.
1) Does it make sense?:
Varkalos. Flimsy shhorki
Pyryalis on the nave,
And zelyuk grunted,
Like mumziki in MOV.
The main thing:
1. Without using third-party libs.
2. Without using training data.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question