Chatscript add foreign language

786 Views Asked by At

I am using Chatscript to create a customer service bot. I have created a custom bot so far using the German pre-built bot as template, but the problem is that I cannot understand how to add a foreign language (in my case Greek). The most relevant link I found is https://github.com/bwilcox-1234/ChatScript/blob/master/WIKI/ESOTERIC-CHATSCRIPT/ChatScript-Foreign-Languages.md, but this is not very helpful.

More specifically, I have placed a dictionaty txt file inside /DICT/GREEK folder. Additionally, I copied file systemfacts.txt inside folder /LIVEDATA/GREEK (I do not yet have more txts). Do I any need any more material in order to support a new language? If yes, what do I need exaclty? I know that POS taggging is needed as well eventually. I have a customer POS tagger with an API, but I do not know how chatscript should interact with it (at which point the call should be made and what kind of response is expected).

Finally, how do I tell my bot explicitly to use the new language? I checked the German bot as a reference but I did not find any such command.

2

There are 2 best solutions below

0
On

ChatScript (CS) integration with a foreign language (not English) is possible but it require work todo:

  • dictionary
  • ontologies (wordnet like)
  • interjections/etc.

I have a customer POS tagger with an API, but I do not know how chatscript should interact with it (at which point the call should be made and what kind of response is expected).

You can do that with a systema call to your exteral POS tagger, see as an example: https://github.com/bwilcox-1234/ChatScript/tree/master/RAWDATA/GERMAN

BTW, now CS foresee fast integration with Treetagger (licence required); but I fair Greek language is not foreseen.

0
On

In order to explicitly use the language, you need to call ChatScript with the language= flag:

./ChatScript local language=GREEK

In order to have conditional blocks in your code that will only be parsed when CS is run with that language flag, encase the lines with ##<<GREEK and ##>>. Like so:

##<<ENGLISH
  Hello
##>>
##<<GREEK
  Χαίρετε
##>>

You can also do these as one-liners, and sometimes in the middle of patterns, but it can be very temperamental and so I would avoid doing so and try and be relatively verbose. Also be aware that when you switch language, you have to rebuild everything again with :build 0 and :build botname

Also note that the conditional language blocks are compiled into the TOPICS at build-time, not interpreted at run-time.

Georgio's answer explains the dictionaries and ontologies. Currently, there are other languages like French, Spanish, German, but not Greek. Unfortunately I can't help with the complex nature of generating Greek ontology files.