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

wordnet with drug names
 
 

I want to have a pattern where I use ~medicine and have it match any drug. e.g. Lipitor, Adderal, etc.

http://wordnet-online.freedicts.com/ says it is a wordnet dictionary and it has all of these drugs in it and evenhas them mapped as ~medicine.

Does anyone know how I can get that wordnet dict added to the one in CS?

 

 
  [ # 1 ]

Adderal does NOT appear to be in wordnet on the site you referred to

 

 
  [ # 2 ]

you are correct but Lipitor is in there though.

I figured there isn’t a prebuilt file that I can use so I figured I could try to extend the existing DICT to have the drugs.

I have downloaded a list of the 200 top drugs; their registered names, their generic name, and their drug category. After doing a little RegEx on it I have created a series of lines that look like this:

Atorvastatin is Lipitor )
Lipitor is Cholesterol_drug )
Cholesterol_drug is medication~

I figure I can add this to the facts.txt file in one of the languages ENGLISH or BASIC and voila!

however,

When I add the above lines to the top of the DICT\ENGLISH\facts.txt file and delete the facts.bin and start up CS I am getting…

dict changed on read of facts 4 in my exitlog.txt No other errors or messages.

 

 

 
  [ # 3 ]

So do you need this hierarchy. Isn’t it enough to just do concept: ~medicine (Lipitor ....) or concept: ~medicine NOUN NOUN_SINGULAR (Lipitor ...)

 

 
  [ # 4 ]

I am writing a bot to talk about drug coverage.

I have looked in the DICT files and I see

Lipitor meanings=1 NOUN NOUN_PROPER_SINGULAR 
    
atorvastatin~1n 

atorvastatin 
meanings=1 glosses=1 NOUN NOUN_SINGULAR COMMON2 COMMON1 
    
Lipitor~1nz (^lipid-lowering_medication~1an oral drug that is effective in lowering triglycerides

 lipid
-lowering_medication meanings=1 glosses=1 NOUN NOUN_SINGULAR 
    
statin~1nz (^medicine~3a medicine that lowers blood cholesterol levels by inhibiting HMG-CoA reductase 

I want this same thing for the 200 most common drugs. Adderall is not in the current DICT. I want to add it and a bunch more.

The doc on Languages and the Advanced User Manual make is sound like we can extend the DICT ourselves.

 

 
  [ # 5 ]

Yes, it is possible, not convenient but possible. But I still dont know why you cant just create a concept with the words you want added..

In your case you only erased facts.bin.  Try erasing both facts.bin and dict.bin

 

 
  [ # 6 ]

I want to have the drugs, generics, and types be a part of wordnet just like Lipitor already is. That way, I can use ~medicine or ~drug in my patterns and topic keywords.

Can the concept: or ^createFact( foo is bar) mechanisms make it so the new drugs match wordnet’s ~medicine? I haven’t been able to do it.

For a bulk add of 200+ drugs, I can use a table macro like this:

concept: ~common-prescription()
table: ~drugdata($_generic $_drug $_type)
    
$_drugType = ^join$_type _ drug)
    ^
createfact($_generic member $_drug)
    ^
createfact($_drug member $_drugType )
    ^
createfact($_drugType member ~common-prescription )
    ^
createfact($_drugType is medicine~)

DATA:
Levothyroxine Synthroid Thyroid_Hormone
Hydrocodone_APAP Vicodin Pain_Relief 

Then my patterns and keywords have to be [~medicine ~common-prescription] and they don’t hook up to the rest of wordnet above ~medicine. Seems to break some of the elegance of ChatScript and wordnet.

 

 
  [ # 7 ]

I want to have the drugs, generics, and types be a part of wordnet just like Lipitor already is. That way, I can use ~medicine or ~drug in my patterns and topic keywords.

Can the concept: or ^createFact( foo is bar) mechanisms make it so the new drugs match wordnet’s ~medicine? I haven’t been able to do it.

For a bulk add of 200+ drugs, I can use a table macro like this:

concept: ~common-prescription()
table: ~drugdata($_generic $_drug $_type)
    
$_drugType = ^join$_type _ drug)
    ^
createfact($_generic member $_drug)
    ^
createfact($_drug member $_drugType )
    ^
createfact($_drugType member ~common-prescription )
    ^
createfact($_drugType is medicine~)

DATA:
Levothyroxine Synthroid Thyroid_Hormone
Hydrocodone_APAP Vicodin Pain_Relief 

Then my patterns and keywords have to be [~medicine ~common-prescription] and they don’t hook up to the rest of wordnet above ~medicine. Seems to break some of the elegance of ChatScript and wordnet.

 

 
  [ # 8 ]

First, if you really require your drugs to be full dictionary words, you have to edit both some dictionary words file AND the facts.txt file. Then remove dict.bin and facts.bin and run CS.  Facts are represented with pointers to dictionary entries. The dictionary is loaded first, then the facts. Your fact introduced a new word to the dictionary after the fact, which was not allowed.

BUT… I dont really believe you need to do any such fancy things because I don’t believe your use case really involves needing your words to be fully wired into the dictionary (eg do you actually do things like refer to entity~1 in your concepts?). You have stated you want to be able to use ~drug or ~medicine in your patterns and that is just a simple addition to the concept definitions. Where do you actually USE medicine~3 in a concept or pattern?  You can define a concept that is that + your new stuff, for example. YES, it is not elegant. But hacking the dictionary source files isn’t really elegant either.

 

 
  login or register to react