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..

Flags and Markers for parsing
 
 

Hi Everyone
I want to start parsing data out of chatscript, like content from inputs and outputs. Is there some type of symbol or notation I can use for the system that I can have my parser look for, for example
t: ^repeat() ^keep() ^respond(~randomtalk) Hello how are you

I want to do something like
t: ^repeat() ^keep() ^respond(~randomtalk) #statement1 Hello how are you #statement1

so I can look for #statement1 and #statement 1 and parse the text inside of it

Thanks

 

 
  [ # 1 ]

I don’t really understand your question/code/example.  when you say #statement1, do you mean to capture what user said and echo it back?

I dont see the topic ~randomtalk, but I can imagine it merely makes some random output like “nice weather today.”
Are you saying if the user then replies “I am great”, you want to then say “Hello how are you I am great”

In other words, give me a concrete example of what the input sequence between user and bot should look like.
And some imaginary code to illustrate what you mean by “parse text inside of it.

 

 
  [ # 2 ]

From the example below I would like to extract
Are you a fan of the Popeye cartoons?
I used to watch him as a child. Did you lust after Olive Oyl?
Me neither. She was too skinny.
You probably like skinny models.

#! I like spinach
s: ( I like spinach ) Are you a fan of the Popeye cartoons?

a: ( ~yes )  I used to watch him as a child. Did you lust after Olive Oyl?
      b: ( ~no ) Me neither. She was too skinny.
      b: ( yes ) You probably like skinny models.

I was trying to do this by putting the text with something around it like this
s: ( I like spinach ) @ Are you a fan of the Popeye cartoons? @
So I can search each line, look for the @ and extract the text inbetween
But I was getting bad factset errors

 

 
  [ # 3 ]

You need to use characters or tokens that CS doesnt want to interpret as having special meaning.  You could use * or |. Or you can use special tokens like ^x()  where you define an outputmacro: ^x()  to not do anything.  If ALL you want to do is extract outputs and have no code in them, you could write a script to read every rule of a topic and do something with the output, using ^getrule(OUTPUT ...)

 

 
  login or register to react