AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

NLP of math problems
 
 

One of the primary functions that any AI/chatbot should be able to perform is math.
Since computers can be great at math processing, NLP math is an excellent subdomain for exploring conversational capabilities.

For those looking to explore this area here are some inputs to start you off:

2 + 2
2 + 2=?
3,000,000+1,234

What is 2+2?
what is 2 plus 2
what is 2 add 2?
What is two and two?

What is 2 - 2?
What is 2 minus 2?
What is 2 take away 2?

23*3
23x3
how much is 23 times three?

After you have handled basic math it is time for more NLP oriented tasks.
Conversion of words to numbers and numbers to words.

USER:3,000,000+1,234
AI
Three millionone thousandtwo hundred thirty four.
USER:What is 3456 in roman numerals?
AIMMMCDLVI is the Roman Numeral for 3456. 

In Skynet-AI there are general routines for Algebra Word Problems.
I took inspiration from STUDENT a MIT 1964 Thesis by Daniel G. Bobrow. Marvin Minsky was the thesis advisor.

The STUDENT problem solving system, programmed in LISP, accepts as input a comfortable but restricted subset of English which can express a wide variety of algebra story problems.

If you had three apples and took one away how many do you have?
The price of a radio is 69.70. If this price is 15 percent less than the marked price, find the marked price.


Let me know how you progress.

 

 
  [ # 1 ]
Merlin - Jun 15, 2014:

how much is 23 times three?

http://elizabot.com/entry/ - Jun 16, 2014:

Judge: how much is 23 times three?
Elizabot: My calculation is 23*3 therefore my answer is 69

Elizabot has not learned Algebra yet. 

http://elizabot.com/entry/ - Jun 16, 2014:

Judge: 5 = 3 + x. Solve for x.
Elizabot:  Adam, leash… alphabetic character, figure… infer, factorise… 5 would be: The cardinal number that is the sum of four and one.

In theory, that should be possible.

8pla.net test run - Jun 16, 2014:

Basic Algebra: a = b + x.
Solve for x.

Input integer a: 5
Input integer b: 3

5 = 3 + x.
Solve for x.

x = 2

Thanks for starting this thread.  It’ll come in handy.

 

 

 
  [ # 2 ]

I added some algebra a couple versions ago.
It doesn’t get much use so it may still be fragile.

USER:x+3=5
AI
:  two

USER
:five equals three minus x
AI
Minus two.

USER:Does two plus three equal six?
AIYou tell meDoes 56?? 

 

 

 
  [ # 3 ]

“equals”. Now there’s one keyword I overlooked. Does that kind of question ever get asked?

Speaking of NLP, the only thing I’m still puzzled on is how to distinguish when e.g.
“What do 2 eggs and 1 spoon of milk make?” should be answered by “3” or “an omelet”.

 

 
  [ # 4 ]
Don Patrick - Jun 16, 2014:

Speaking of NLP, the only thing I’m still puzzled on is how to distinguish when e.g.
“What do 2 eggs and 1 spoon of milk make?” should be answered by “3” or “an omelet”.

In terms or NLP, we may try to get an answer by reversing the question.

An omelet do make a spoon of milk and two egges taset good.
An omelet does make a spoon of milk and two eggs taste good.

do make 2 eggs and 1 spoon of milk.
3 does make 2 eggs and 1 spoon of milk

Ha!  That is puzzling.  Perhaps “3” is the answer.  Since you are using digits they are a plural set.  “3 [things] do make 2 eggs and 1 spoon of milk.”  Had you used the number names “one”, “two”, “three” they would be singular names. “[Three] does make 2 eggs and 1 spoon of milk.”

With that said… This is still puzzling.  Please feel free to fine tune the grammar rules in my comments here. I do hope they help you get started solving the only thing that puzzles you speaking of NLP.

 

 

 
  [ # 5 ]
USER:What do 2 eggs and 1 spoon of milk make?
AITough questionlet me try to find out. (Brings up Wikipedia page for French Toast

LOL

 

 
  [ # 6 ]
HumanWhat do 2 eggs and 1 spoon of milk make?
MitsukuA mess to clean up

LOL

 

 
  [ # 7 ]
Merlin - Jun 16, 2014:
USER:What do 2 eggs and 1 spoon of milk make?
AITough questionlet me try to find out. (Brings up Wikipedia page for French Toast

Very clever smile. Needs bread, though.
Given this example, I suppose that two differently named items provide more significant information than the two numbers at that point, and I could use the rule:
2 apples plus 1 (apple) = 3
2 apples plus 1 tomato = salad

 

 
  [ # 8 ]
Don Patrick - Jun 16, 2014:

“equals”. Now there’s one keyword I overlooked. Does that kind of question ever get asked?

Speaking of NLP, the only thing I’m still puzzled on is how to distinguish when e.g.
“What do 2 eggs and 1 spoon of milk make?” should be answered by “3” or “an omelet”.

‘equals’ is a particularly bothersome “keyword”- how to decide if it is a direct or indirect math operator or something else (like “so we hate equals right”).

Examples of input:

-I didn’t notice the change in two plus two equals four so far.
-I am sure that 2+2 still equals 4.
-violent anime equals emotional scaring.
-Do you mean that a spoon equals the logical value true?
-Well, I’ve learned false is anything that equals zero, and true is anything else.
-Freedom would be deciding to say two plus two equals nine.
-so we hate equals right
-I wasn’t asking you to calculate… *lol* That implies that understanding equals zero, and that in turn is a good reason to laugh out loud.
-i guess that equals 5 gram

 

 

 
  [ # 9 ]

Elizabot is learning Algebra.

JudgeASolve for A.
ElizabotMy calculation is 5-2 therefore my answer is 3

Judge
19 xSolve for x.
ElizabotMy calculation is 19-9 therefore my answer is 10 

PLEASE NOTE:  ALPHA TEST FOR DISCUSSION.
Elizabot has just started her Algebra tutoring!
So she is most certainly still learning Algebra.
There are MANY MORE rules in Algebra she has
not learned yet, so this is only presented as an
alpha test run, for discussion purposes only.

 

 

 
  [ # 10 ]

The NLP demonstration above in Algebra has been simplified for learning purposes. So, Elizabot has started showing signs of improvement in Algebra… The more advanced NLP will be reintroduced at a later stage.

Judgesolve 3x 99
Elizabot
: -33

Judge
solve 33x 99
Elizabot
: -3

Judge
solve 8 4x
Elizabot
: -2

Judge
solve 4x 8
Elizabot
: -

Still, basic Algebra tutoring is needed.

Attention Students:  Do not ask Elizabot for your math homework questions.  As a new Algebra student just like you may be… Elizabot may not always get the correct answer.  That’s because there is still Algebra that Elizabot simply has not learned yet, but sometimes she may go for it anyway and try her best to answer.

This Algebra demo is provided “as is”, for discussion purposes only, with no guarantee or warranty whatsoever.  Therefore, any use is entirely at your own risk.

 

 
  [ # 11 ]

“Attention Students:  Do not ask Elizabot for your math homework questions.  As a new Algebra student just like you may be… Elizabot may not always get the correct answer.  “

Those don’t look right.

Judge: solve 3x * 99
Elizabot: -33


Why -33?
Only if you are trying to get:-9801

 

 
  [ # 12 ]

I had more or less the same question, actually. All of those equations are incomplete, due to the missing equality ‘statement’. You can plug in just about any number and get completely different values for x. I assume that all of the equations are “= 0” (in which case several answers are incorrect, including the 3x * 99 problem), but assuming anything is rather dangerous, don’t you think?

I was going to “map out” the math to solve 3x * 99 problem, using equalities of 0 and 1, but while I’m good with math, I don’t really enjoy doing it.

 

 
  [ # 13 ]

If they’re supposed to be “= 0”, then I’m pretty sure they’re all correct except for the 3x * 99 one (for which the correct solution is 0). Or are there additional examples outside of this thread of which I am not aware?

 

 
  [ # 14 ]

You’re right, Jarrod. My mind must have been elsewhere during that portion of my response. No excuse for it, either. red face

 

 
  [ # 15 ]

Thanks for tutoring Elizabot in Algebra. That’s the correct answer Merlin, Jarrod ... And, Dave is correct, that without “x=” the answers would be marked incorrect on an Algebra exam. However, restrictive natural language processing makes tutoring chatbots in Algebra easier.  Unlike human students, chatbot students can be reprogrammed once the subject is mastered. Showing Elizabot’s work explains how she attempted to get the correct answer.

/* <o> <o> */

/* Algebra Addition Sign */

Judgesolve 3x 99 0     
Elizabot
: -33

Judge
solve 3x 99
Elizabot
: -33


/* Algebra Multiplcation Sign */

Judgesolve 3x 99 0     
Elizabot
: -33

Judge
solve 3x 99
Elizabot
: -33


Judge
solve 3 33         
Elizabot
What was the question that?  Triadiii... cipherfigure... answer
answer... Solve would beFind the solution to  (a problem or question
or 
understand the meaning of

/* Mathematics Multiplcation */

Judgewhat is 3 33        
Elizabot
My calculation is 3*33 therefore my answer is 99

/* <o> <o> */ 

Less than a week after Carl B, made the excellent suggestion that chatbots should know Algebra…. Elizabot, still being tutored in Algebra, has not learned to use the multiplication sign (for Algebra) yet. So, as told in advance on this thread, bound by a restrictive natural language processing for learning purposes, she assumed the addition sign (for Algebra). 

/* <o> <o> */

WEBMASTER, Please have a look. Thanks!

 

 1 2 > 
1 of 2
 
  login or register to react