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

How to implement a Chatscript bot that talk Portuguese
 
 
  [ # 31 ]

Thank you Dave Morton for your encouragement words! wink

 

 
  [ # 32 ]

Is it possible the bot output more the one time, that is, fire two gambits without the user enter a information?

example:

t: () Hello user!
t: () How are you?

I got it, using the OOB and setTimeout function on javascript to send a “invisible” information to chatscript without the user perceive, but I’d like to know if there is another way to do that.

 

 
  [ # 33 ]

I’m using a external POS TAGGER.

I’m unable using this functionality ( word ? ~concept) inside a IF statement. It just works in a pattern.

For example:

The word “dançar” (it means dance) is a verb in portuguese. As we can see using the command :prepare

caneta: > :prepare dançar


Command: :prepare dançar
TokenControl: DO_SUBSTITUTES DO_NUMBER_MERGE DO_DATE_MERGE NO_HYPHEN_END


Original User Input: dançar
Tokenized into: dançar
Actual used input: dançar


Concepts:

1: dançar (raw):  +~verbo //
1: danç (canonical):  +danç //  +~utf8

Sequences:
+dançar +~atividades_prazerosas +~atividadesAfter parse TokenFlags: USERINPUT
JUNIOR: 
caneta: > 


But within an IF statement the Chatscript can not detect.

....,....,....NOPROBLEM (^next) => dançar
....,....,.... _1 = ^next(dançar)
....,....,....if _1 (dançar) !=  e AND
....,....,....if _1 (dançar) !=  ,  AND
....,....,....if _1 (dançar) !=  .  AND
....,....,....if _1 (dançar) !=  !  SetContains dançar ~verbo :  not within

....,....,......if _1 (dançar) ?  ~verbo   FAIL-if   <<<<————HERE THE CHATSCRIPT FAIL IN DETECT THE WORD DANÇAR AS A VERB.


Someone could help me?


Thanks,
Oberdan Alves

 

 
  [ # 34 ]

The fastest easiest answer is:
if it works in a pattern, then use
if (PATTERN )
notation and put your pattern in there.

 

 
  [ # 35 ]
Bruce Wilcox - Oct 17, 2016:

The fastest easiest answer is:
if it works in a pattern, then use
if (PATTERN )
notation and put your pattern in there.

Sorry Bruce, I made a mistake. I was testing the pattern in this way u:(_~verbo). In this way it is ok. But I need know if the word is a verb within a IF statement. So I need a pattern like that u: (_ ? ~verbo), but it does not exist.

So, I’m trying figure out how would I know if a word is a verb within a IF statement.

Thanks,
Oberdan Alves

 

 
  [ # 36 ]

if (PATTERN _~verbo)
works just like your pattern.

 

 
  [ # 37 ]
Bruce Wilcox - Oct 18, 2016:

if (PATTERN _~verbo)
works just like your pattern.

Sorry again Bruce, I forgot to mention that I have a variable before of the verb to test, like ($$var ? ~verb). Now is exactly the pattern that I need.

Sorry again for you lost your time.

Thanks,
Oberdan Alves

 

 
  [ # 38 ]

So you are trying to ask if some variable value, NOT coming from your input, is a verbo?
If you have a concept set of all ~verbo members, then the if test works directly if ($$var ? ~verbo) or
if (PATTERN $$var?~verbo)
In english this wouldnt work because ~verb is a dynamic set managed by the pos-tagger so it is not a fixed set.

 

 
  [ # 39 ]

Thank you Bruce for your response.

The word that I had tested is a verb came from input, but before I test it, I had burst the sentence which contained the verb, saved it in a factset and then I did the test.

I did not know that a concept created dynamically through of the pos-tagger (in my case a external pos-tagger) could not be tested in that way.


Thank you so much and sorry for the mess.
Oberdan Alves

 

 
  [ # 40 ]

Hello everybody!

I’d like to know if is possible to use the substitutes.txt file to substitute contraction word to normal words.

Example: In portuguese we have the preposition word “pro” that is a contraction of the words “para o” (to the). I edited the substitutes.txt and put in it the word “pro” to substitute to “para o”.

When I use the command :prepare the last word in the sentence is not recognized when the sentence has this contraction word. And the function ^setoriginal shows a fail too. Is there a solution for it?


caneta: > :prepare eu gosto de ir pro cinema
TokenControl: DO_SUBSTITUTES DO_NUMBER_MERGE DO_DATE_MERGE NO_HYPHEN_END


Original User Input: eu gosto de ir pro cinema <== (Translated to english means “I like to go to the cinema”)
Tokenized into: eu gosto de ir pro cinema
Substituted (substitutes ) into: eu gosto de ir para o cinema <<=(Here we can see the word “pro”, that is a contraction word, was expanded
Actual used input: eu gosto de ir para o(pro) cinema                                                                                     to “para o”)


Concepts:

1: eu (raw):  +~pron_pessoal //
1: eu (canonical):  +eu // 

2: gosto (raw):  +~verbo //
2: gost (canonical):  +gost // 

3: de (raw):  +~preposicao //
3: de (canonical):  +de // 

4: ir (raw):  +~verbo //
4: ir (canonical):  +ir // 

5: para (raw):  +~preposicao //
5: par (canonical):  +par // 

6: o (raw):  +~artigo //
6: o (canonical):  +o //  <<== BUT HERE THE WORD CINEMA WAS NOT RECOGNIZED.

Sequences:
After parse TokenFlags: DO_SUBSTITUTES USERINPUT
JUNIOR: 
caneta: >

 

 
  [ # 41 ]

I believe the trick is for separating multiple words you need to use an underscore instead of a space in the substitutes.txt file.

so try:

paro_o pro

or double quotes:

“paro o” pro

Glad to see are making progress on your chatbot!

 

 
  [ # 42 ]
Alaric Schenck - Nov 2, 2016:

I believe the trick is for separating multiple words you need to use an underscore instead of a space in the substitutes.txt file.

so try:

paro_o pro

or double quotes:

“paro o” pro

Glad to see are making progress on your chatbot!


Thank you so much Alaric for your response.

I think I did not express myself well. Is the opposite. The contraction word to the normal word.

Example:

pro “para o”

I already put it in double quotes, if I use underscore the chatscript shows a warning (as you can see in the final of the message).

I think that chatscript save the number of words that are in the original sentence and it does not allow that I use the function ^setoriginal with a wordindex bigger than the number of words that are in the original sentence.

I’m using the function ^setoriginal because I am working with external pos tagger.


Warning message:

Warning—substitution replacement para_o of pro in substitutes.txt at line 35 has _ in it

 

 

 
  [ # 43 ]

Oberdan,

I tested it on the CS 6.84 default HARRY chatbot and it works for me.

I added the follow entry to the substitutes.txt as the first row:
pro para_o
a.i. artificial+intelligence

I issued a :build 0 command.  I did not see the warning message you received about the underscore but I would just ignore it anyways.

The keywordless.top file has a pattern that repeats what you enter if you use the word “say”.

sample output:
alaric: > say pro
HARRY:  Para o

I think the issue is with your understanding of the ^setoriginal function.  I think the “original” word is lost when substitutions and spelling corrections, etc are implemented. “Paro o” becomes the original word.

 

 

 

 
  [ # 44 ]
Alaric Schenck - Nov 4, 2016:

Oberdan,

I tested it on the CS 6.84 default HARRY chatbot and it works for me.

I added the follow entry to the substitutes.txt as the first row:
pro para_o
a.i. artificial+intelligence

I issued a :build 0 command.  I did not see the warning message you received about the underscore but I would just ignore it anyways.

The keywordless.top file has a pattern that repeats what you enter if you use the word “say”.

sample output:
alaric: > say pro
HARRY:  Para o

I think the issue is with your understanding of the ^setoriginal function.  I think the “original” word is lost when substitutions and spelling corrections, etc are implemented. “Paro o” becomes the original word.


Thank you Alaric for your contribution!


The warning message is just showed when I use the command :build name_my_bot

The function ^setoriginal is extremely necessary when we work with external pos-tagger. I am quite sure that the problem is the number of words in the original sentence and the actual sentence. Since the function ^setoriginal works with index.

 

 
  [ # 45 ]

Hello people!

I’d like some help.

I’d like use postgresql in my chatbot. I am using Linux Ubuntu 16.04 LTS. I read in the manual that I have to run Chatscriptpg to use postgresql, but this file does not exist in my /BINARIES. So I tried to run the command: make pgserver to create it. But the error in the attached file is shown.

Someone can help me?

 

File Attachments
error.txt  (File Size: 13KB - Downloads: 91)
 

 < 1 2 3 4 > 
3 of 4
 
  login or register to react