wynnb / negex

Automatically exported from code.google.com/p/negex
0 stars 0 forks source link

how to use pyConTextNLP #4

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Try to use the function analyzeReport(report, targets, modifiers ) provided 
in the wiki page
2.Define report = "Cardiac examination demonstrated regular rate and rhythm, no 
murmur, rubs, or gallops.", modifiers = 
["DEFINITE_NEGATED_EXISTENCE","probable_existence"], targets = []
3.

What is the expected output? What do you see instead?
  File "C:\Documents and Settings\pyConTextNLP\pyConTextGraph\pyConTextGraph.py", line 293, in markItem
    if(not self.res.has_key(item.getLiteral()) ):
AttributeError: 'str' object has no attribute 'getLiteral'

What version of the product are you using? On what operating system?
pyConTextNLP-0.3.0
Windows XP

Please provide any additional information below.

Original issue reported on code.google.com by ouyingw...@gmail.com on 22 Mar 2013 at 8:17

Attachments:

GoogleCodeExporter commented 8 years ago
The names of the classes and methods are so different on the version 0.5.1.9 
comparing to the available instructions. Please update the documentation. Thank 
you!

>>> dir(pyConTextNLP)
['__builtins__', '__doc__', '__file__', '__loader__', '__name__', 
'__package__', '__path__', '__version__', '__version_info__', 'helpers', 
'pyConTextGraph']

>>> dir(pyConTextNLP.pyConTextGraph)
['ConTextDocument', 'ConTextDocumentXMLSkel', 'ConTextMarkup', 
'ConTextMarkupXMLSkel', '__builtins__', '__doc__', '__file__', '__loader__', 
'__name__', '__package__', 'compiledRegExprs', 'copy', 'edgeXMLSkel', 
'nodeXMLSkel', 'nx', 'platform', 'r1', 'r2', 'r3', 'ramp', 're', 'rlt', 
'tagObject', 'tagObjectXMLSkel', 'xmlScrub']

Original comment by henry...@gmail.com on 11 Jun 2014 at 4:00

GoogleCodeExporter commented 8 years ago
I spent a bit of time getting version 0.5.1.9 to work. I had to make a few 
tweaks to the code, namely: 
1. Changed delimiter type to comma in instantiateFromCSVtoitemData function of 
itemData class in itemData.py (line 165). This change makes it possible to load 
rules from .csv files.  
2. Changed elif to if in limitScope function of tagObject class in 
pyContTextGraph.py (line 151). This fixes the error of "bidrectional" rule not 
respecting "terminate" rules.

The attached script can be used to run an example similar to what is posted on 
pyConTextNLP's wiki. The authors may have better insights into how to run the 
algorithm optimally, but this seemed to do the trick for me. 

Original comment by alexsg...@gmail.com on 1 Apr 2015 at 9:11

Attachments:

GoogleCodeExporter commented 8 years ago
Alex, is this the output you expect from your code?

[('aortic dissection', True), ('pulmonary embolism', False)]

I am unclear as to the meaning of the boolean.

Thanks!

Original comment by boris.re...@gmail.com on 1 Aug 2015 at 8:07