X
X
xmoonlight2020-03-23 17:24:28
Algorithms
xmoonlight, 2020-03-23 17:24:28

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

8 answer(s)
A
Andrew Nodermann, 2020-03-23
@Lucian

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
AWwZZbl.gif
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".

M
mayton2019, 2020-03-23
@mayton2019

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.

D
Dmtm, 2020-03-24
@Dmtm

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

V
Victor P., 2020-04-02
@Jeer

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)

O
origami1024, 2020-03-23
@origami1024

Just a short procedure for decomposing the text into entities with their semantic relationships.

There are no entities and semantic connections in the text, the maximum that is there is a sequence of characters built according to very vague rules. The symbols in the text work as reminders of something that is already in the brain and is already connected with all the rest of the information, regardless of the text.
Semantic connections and essences must be sought in the brain, and not in the text.

K
Karpion, 2020-03-24
@Karpion

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


Vasya said:
- There was a blue ball.
Petya objected:
- No, the ball was red.
Your bot must understand the speech of the characters - and take into account that the characters can lie.
Or is it pure narrative, without direct speech?
There will be problems with understanding pronouns - this is, in principle, ambiguous.

A
Alexander Skusnov, 2020-03-25
@AlexSku

1) Does it make sense?:

Varkalos. Flimsy shhorki
Pyryalis on the nave,
And zelyuk grunted,
Like mumziki in MOV.

2) Philosophers are still looking for meaning (in) life. (priests, of course, know: work for the owner, give me 10%, happiness will be after death)
3) Conclusion: one text (a case from the life of a family by the sea) is not enough, it is necessary to briefly describe the life of mankind.

N
Nikolay, 2020-04-20
@SODINNER

The main thing:
1. Without using third-party libs.
2. Without using training data.

This question can be closed. If you want to do this, learn Natural Language Processing.
Well, or machine learning, for example, having a bunch of dialogues, feed the program.
In either of these two cases, you need a third-party lib, training data for the second one only.
Well, or you will have to write this lib yourself, at least the most necessary from this lib.
But since you ask this question, most likely you have not grown up to the level of a programmer yet to be able to write such code, and even alone, because more than one person works on popular libs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question