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

Using JSon to Request Concepts, is Possible?
 
 

Hello, I am building a bot in another language and would like to know if it is possible to use this bot system to query the concepts in a database of type elasticsearch?

I’m studying the possibility of creating an additional module to query the concepts through elastic ... but also I’m seeing that ChatScript works with Json ... I still do not quite understand ...

I could within a topic or in my control script create a function that checks a portion of the text and make a direct query via json in my database to find out if this word is part of a concept?

or would it be easier to modify the built-in functions to perform queries using libcurl and checking the results?

 

 
  [ # 1 ]

It is not easier to modify built in functions and you make it harder to upgrade to later CS versions.
You should be able to use ^JSONopen (which uses libcurl) to query an api that accepts/sends JSON. If you are asking it to return concepts that the word is a part of, you can take the returning concept names and do ^mark(~conceptname _0) on the word (where _0 is where the word is).  So does this answer your question or you need more information?

 

 
  [ # 2 ]
Bruce Wilcox - Jul 14, 2018:

It is not easier to modify built in functions and you make it harder to upgrade to later CS versions.
You should be able to use ^JSONopen (which uses libcurl) to query an api that accepts/sends JSON. If you are asking it to return concepts that the word is a part of, you can take the returning concept names and do ^mark(~conceptname _0) on the word (where _0 is where the word is).  So does this answer your question or you need more information?

Hmmm I understand

is that I have a very large database to import ... I’ve done this by raising up a variable with a maximum limit of 8000. But the query in the file system indexed by ChatScript left the bots with a slow response time ...

I created an api here so I could do this kind of verification ...
where I send a word, a category and get a true / false if it exists or not ..

Now I can do a requester in Json within a topic to do this check .. Is this allowed in the script?
Example, check if the word is an adjective and send that word to my api?

http: // localhost: 54099 / api / smart / myword / searcategory

 

 
  [ # 3 ]

I do not know what “raising up a variable with a maximum limit of 8000” means.  And what is a large database mean—how large.  If you brought in all the data as facts during startup, using CS std ^query calls will be extremely fast.

You can call ^JsonOpen during script execution at any time.

If you have hundreds of thousands of facts of the form (myword member ~myconcept) then those imported facts can either be queried via ^query(direct_svo $_myword member $_myconcept 1)

 

 
  [ # 4 ]
Bruce Wilcox - Jul 15, 2018:

I do not know what “raising up a variable with a maximum limit of 8000” means.  And what is a large database mean—how large.  If you brought in all the data as facts during startup, using CS std ^query calls will be extremely fast.

You can call ^JsonOpen during script execution at any time.

If you have hundreds of thousands of facts of the form (myword member ~myconcept) then those imported facts can either be queried via ^query(direct_svo $_myword member $_myconcept 1)

got it..
Sorry for my English ... Google translator ... hehe

I am using a complete wikipedia database modified to use as concepts ...

Do you think you can import the categories of the bank of wikipedia as concepts without much loss of performance?

 

 
  [ # 5 ]

Probably too much data to load locally. Use JsonOpen or Postgres or Mongo in a query

 

 
  [ # 6 ]
Bruce Wilcox - Jul 15, 2018:

Probably too much data to load locally. Use JsonOpen or Postgres or Mongo in a query

Ok Bruce,
Thanks for All!!!

 

 
  login or register to react