AskNowQA / EARL

Entity And RELation mapping
GNU General Public License v3.0
100 stars 18 forks source link

Incompatible results between LIVE API and local installation #20

Closed liviofreire closed 4 years ago

liviofreire commented 4 years ago

Hello!

I've installed EARL as indicated in README. However I get weird results when run a query, for example:

curl -XPOST 'localhost:4999/processQuery' -H 'Content-Type: application/json' -d"{\"nlquery\":\"Who is the president of USA?\"}"

{"rerankedlists": {"0": [[0.5536420941352844, "http://dbpedia.org/resource/President"], [0.12900513410568237, "http://dbpedia.org/resource/Presidency"], [0.030404455959796906, "http://dbpedia.org/resource/The_President"], [0.02885913848876953, "http://dbpedia.org/resource/The_Presidents_of_the_United_States_of_America_(band)"], [0.012495358474552631, "http://dbpedia.org/resource/Speaker_(politics)"], [0.007223500870168209, "http://dbpedia.org/resource/President_of_Estonia"], [0.004728458821773529, "http://dbpedia.org/resource/President's_%22E%22_Award"], [0.004225569777190685, "http://dbpedia.org/resource/President_of_India"], [0.00378747028298676, "http://dbpedia.org/resource/President_of_Yemen"], [0.0036902434658259153, "http://dbpedia.org/resource/President_of_Abkhazia"], [0.0030627192463725805, "http://dbpedia.org/resource/President_of_Laos"], [0.0030627192463725805, "http://dbpedia.org/resource/President_of_Colombia"], [0.002289264462888241, "http://dbpedia.org/resource/The_President_(2014_film)"], [0.0021337049547582865, "http://dbpedia.org/resource/President_University"], [0.001268348773010075, "http://dbpedia.org/resource/Chancellor_(education)"], [0.0004659400146920234, "http://dbpedia.org/resource/Sosai"], [0.000256964034633711, "http://dbpedia.org/resource/Rector_(academia)"], [0.0002468969614710659, "http://dbpedia.org/resource/President_(card_game)"], [0.00024368573212996125, "http://dbpedia.org/resource/Pr\u00e9sident_(brand)"], [0.00023866206174716353, "http://dbpedia.org/resource/The_President_(1961_film)"], [0.0002059761609416455, "http://dbpedia.org/resource/Graisse"], [0.00017089983157347888, "http://dbpedia.org/resource/The_President's_Lady"], [0.00012262043310329318, "http://dbpedia.org/resource/Carlo_Biotti"], [0.00011634613474598154, "http://dbpedia.org/resource/My_President"], [0.00011295441800029948, "http://dbpedia.org/resource/The_Death_of_a_President"], [6.297003710642457e-05, "http://dbpedia.org/resource/Portrait_of_a_President"], [4.98787485412322e-05, "http://dbpedia.org/resource/President_of_the_Government"], [4.9208945711143315e-05, "http://dbpedia.org/resource/Presidents_and_Prophets"], [4.746868580696173e-05, "http://dbpedia.org/resource/President's_Award"], [3.637570989667438e-05, "http://dbpedia.org/resource/SS_President"]], "1": [[0.01221555843949318, "http://dbpedia.org/ontology/country"], [0.01113790925592184, "http://dbpedia.org/ontology/Country"], [0.007336166687309742, "http://dbpedia.org/ontology/unitedStatesNationalBridgeId"], [0.00023866206174716353, "http://dbpedia.org/ontology/domain"], [0.00015441638242918998, "http://dbpedia.org/ontology/state"], [0.0001491083821747452, "http://dbpedia.org/ontology/kingdom"]]}, "changes": {"0": "correct", "1": "change", "2": "change", "3": "correct"}, "chunktext": [{"chunk": "president", "surfacelength": 9, "class": "entity", "surfacestart": 11}, {"chunk": "USA", "surfacelength": 3, "class": "relation", "surfacestart": 24}], "er-rerun": true, "ertypes": ["entity", "relation"]}(earl)

any suggestion to solve this problem?

debayan commented 4 years ago

Hello,

I will need some time to re-install EARL using current README instructions and see if I can reproduce your issue. Will take some time, kindly be patient. I will let you know soon.

debayan commented 4 years ago

Please send me the full output as visible on EARL command line for all the stages. Also, please send me the list of python packages installed and their versions.

liviofreire commented 4 years ago

Thanks for the quick response! The outputs follow bellow as requested:

Package Version
absl-py 0.2.1
astor 0.6.2
backports.shutil-get-terminal-size 1.0.0
backports.weakref 1.0.post1
bitarray 1.2.1
bleach 1.5.0
boto 2.49.0
boto3 1.12.0
botocore 1.15.0
bz2file 0.98
certifi 2019.11.28 chardet 3.0.4
Click 7.0
decorator 4.4.1
docopt 0.6.2
docutils 0.15.2
editdistance 0.5.3
elasticsearch 7.5.1
enum34 1.1.6
Flask 1.1.1
funcsigs 1.0.2
future 0.18.2
futures 3.3.0
fuzzywuzzy 0.18.0
gast 0.2.0
gensim 3.8.1
gevent 1.4.0
greenlet 0.4.15
grpcio 1.12.0
h5py 2.7.1
html5lib 0.9999999
idna 2.8
ipython 5.9.0
ipython-genutils 0.2.0
itsdangerous 1.1.0
Jinja2 2.11.1
jmespath 0.9.4
Keras 2.2.4
Keras-Applications 1.0.6
Keras-Preprocessing 1.0.5
Markdown 2.6.11
MarkupSafe 1.1.1
mock 2.0.0
nltk 3.4.5
numpy 1.16.1
pathlib2 2.3.5
pbr 4.0.3
pexpect 4.8.0
pickleshare 0.7.5
pip 19.2.3
pipreqs 0.4.10
practNLPTools 1.0
prompt-toolkit 1.0.18
protobuf 3.5.2.post1 ptyprocess 0.6.0
pybloom 1.1
Pygments 2.5.2
python-dateutil 2.8.1
python-Levenshtein 0.12.0
PyYAML 3.12
requests 2.22.0
s3transfer 0.3.3
scandir 1.10.0
scikit-learn 0.19.1
scipy 1.2.3
setuptools 41.4.0
simplegeneric 0.8.1
singledispatch 3.4.0.3
six 1.14.0
sklearn 0.0
smart-open 1.9.0
stop-words 2015.2.23.1 tensorboard 1.8.0
tensorflow 1.8.0
termcolor 1.1.0
textblob 0.15.3
torch 1.1.0
traitlets 4.3.3
urllib3 1.25.8
wcwidth 0.1.8
Werkzeug 1.0.0
wheel 0.33.6
xgboost 0.82
yarg 0.1.9

ErPredictorES.py ('Who', tensor([4.3699e-29, 1.0000e+00], grad_fn=), tensor(4.3699e-29, grad_fn=)) ('the parent organisation', tensor([2.0238e-36, 1.0000e+00], grad_fn=), tensor(2.0238e-36, grad_fn=)) ('Barack Obama', tensor([9.7861e-11, 1.0000e+00], grad_fn=), tensor(9.7861e-11, grad_fn=)) ('is', tensor([1., 0.], grad_fn=), tensor(1., grad_fn=)) [{'chunk': 'Who', 'surfacelength': 3, 'class': 'relation', 'surfacestart': 0}, {'chunk': 'the parent organisation', 'surfacelength': 23, 'class': 'relation', 'surfacestart': 7}, {'chunk': 'Barack Obama', 'surfacelength': 12, 'class': 'relation', 'surfacestart': 34}, {'chunk': 'is', 'surfacelength': 2, 'class': 'entity', 'surfacestart': 4}] ('Who', tensor([4.3699e-29, 1.0000e+00], grad_fn=), tensor(4.3699e-29, grad_fn=)) ('the parent organisation', tensor([2.0238e-36, 1.0000e+00], grad_fn=), tensor(2.0238e-36, grad_fn=)) ('barack obama', tensor([0., 1.], grad_fn=), tensor(0., grad_fn=)) ('is', tensor([1., 0.], grad_fn=), tensor(1., grad_fn=)) [{'chunk': 'Who', 'surfacelength': 3, 'class': 'relation', 'surfacestart': 0}, {'chunk': 'the parent organisation', 'surfacelength': 23, 'class': 'relation', 'surfacestart': 7}, {'chunk': 'barack obama', 'surfacelength': 12, 'class': 'relation', 'surfacestart': 34}, {'chunk': 'is', 'surfacelength': 2, 'class': 'entity', 'surfacestart': 4}]

ErPredictor.py [{'chunk': 'Who', 'surfacelength': 3, 'class': 'entity', 'surfacestart': 0}, {'chunk': 'the parent organisation', 'surfacelength': 23, 'class': 'relation', 'surfacestart': 7}, {'chunk': 'Barack Obama', 'surfacelength': 12, 'class': 'entity', 'surfacestart': 34}, {'chunk': 'is', 'surfacelength': 2, 'class': 'relation', 'surfacestart': 4}]

JointLinker.py {'chunktext': [{'chunk': 'Who', 'surfacelength': 3, 'class': 'entity', 'surfacestart': 0}, {'chunk': 'the parent organisation', 'surfacelength': 23, 'class': 'relation', 'surfacestart': 7}, {'chunk': 'Barack Obama', 'surfacelength': 12, 'class': 'entity', 'surfacestart': 34}, {'chunk': 'is', 'surfacelength': 2, 'class': 'relation', 'surfacestart': 4}], 'nodefeatures': {0: {u'http://dbpedia.org/resource/Yara-ma-yha-who': {'connections': 0.0, 'esrank': 12, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/WHO-DT': {'connections': 0.0, 'esrank': 3, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who_Made_Who': {'connections': 0.0, 'esrank': 20, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Vinnie_Who': {'connections': 0.0, 'esrank': 28, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who': {'connections': 0.0, 'esrank': 1, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who_Knows_Who': {'connections': 0.0, 'esrank': 21, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Girls_Who_Like_Boys_Who_Like_Boys': {'connections': 0.0, 'esrank': 22, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who_Made_Who_(song)': {'connections': 0.0, 'esrank': 18, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Girls_Who_Like_Boys_Who_Like_Boys_(book)': {'connections': 0.0, 'esrank': 24, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who_Is_Dr_Who': {'connections': 0.0, 'esrank': 16, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Chi_(Who)': {'connections': 0.0, 'esrank': 8, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who_Made_Who_World_Tour': {'connections': 0.0, 'esrank': 14, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who%3F_(novel)': {'connections': 0.0, 'esrank': 4, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Vem_\xe4r_det': {'connections': 0.0, 'esrank': 23, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Doctor_Who': {'connections': 0.0, 'esrank': 26, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who_Cares': {'connections': 0.0, 'esrank': 29, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who%3F_(album)': {'connections': 0.0, 'esrank': 11, 'sumofhops': 0.0}, u"http://dbpedia.org/resource/Who_I_Am_Hates_Who_I've_Been": {'connections': 0.0, 'esrank': 15, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who_Shall_Live_and_Who_Shall_Die': {'connections': 0.0, 'esrank': 19, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who,_What,_Wear': {'connections': 0.0, 'esrank': 6, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who_Dunnit': {'connections': 0.0, 'esrank': 30, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who_Killed_Who%3F': {'connections': 0.0, 'esrank': 17, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/The_Who': {'connections': 0.25, 'esrank': 31, 'sumofhops': 0.5}, u'http://dbpedia.org/resource/Who_Booty': {'connections': 0.0, 'esrank': 25, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Ledipasvir': {'connections': 0.0, 'esrank': 27, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who%3F_Who%3F_Ministry': {'connections': 0.0, 'esrank': 2, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who_Covers_Who%3F': {'connections': 0.0, 'esrank': 13, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who,_whom%3F': {'connections': 0.0, 'esrank': 10, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who,_Me': {'connections': 0.0, 'esrank': 5, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/WHO/PES': {'connections': 0.0, 'esrank': 7, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Who%3F_(song)': {'connections': 0.0, 'esrank': 9, 'sumofhops': 0.0}}, 1: {u'http://dbpedia.org/property/organizations': {'connections': 0.0, 'esrank': 16, 'sumofhops': 0.0}, u'http://dbpedia.org/ontology/parent': {'connections': 0.25, 'esrank': 5, 'sumofhops': 0.125}, u'http://dbpedia.org/ontology/organisation': {'connections': 0.0, 'esrank': 6, 'sumofhops': 0.0}, u'http://dbpedia.org/property/organiztion': {'connections': 0.0, 'esrank': 17, 'sumofhops': 0.0}, u'http://www.telegraph.co.uk/finance/property/renting/11908002/Generation-rent-the-reluctant-rise-of-the-older-tenant.html': {'connections': 0.0, 'esrank': 18, 'sumofhops': 0.0}, u'http://dbpedia.org/property/organisations': {'connections': 0.0, 'esrank': 13, 'sumofhops': 0.0}, u'http://dbpedia.org/property/organization': {'connections': 0.0, 'esrank': 14, 'sumofhops': 0.0}, u'http://dbpedia.org/property/parnet': {'connections': 0.0, 'esrank': 26, 'sumofhops': 0.0}, u'http://dbpedia.org/property/parent': {'connections': 0.0, 'esrank': 12, 'sumofhops': 0.0}, u'http://dbpedia.org/property/organisation': {'connections': 0.0, 'esrank': 8, 'sumofhops': 0.0}, u'http://dbpedia.org/ontology/parentOrganisation': {'connections': 0.0, 'esrank': 1, 'sumofhops': 0.0}, u'http://dbpedia.org/property/parantOrganization': {'connections': 0.0, 'esrank': 9, 'sumofhops': 0.0}, u'http://dbpedia.org/property/urbanisation': {'connections': 0.0, 'esrank': 15, 'sumofhops': 0.0}, u'http://dbpedia.org/property/theN': {'connections': 0.0, 'esrank': 19, 'sumofhops': 0.0}, u'http://dbpedia.org/property/perent': {'connections': 0.0, 'esrank': 25, 'sumofhops': 0.0}, u'http://dbpedia.org/property/parentCo.': {'connections': 0.0, 'esrank': 11, 'sumofhops': 0.0}, u'http://dbpedia.org/property/theE': {'connections': 0.0, 'esrank': 20, 'sumofhops': 0.0}, u'http://dbpedia.org/property/theA': {'connections': 0.0, 'esrank': 21, 'sumofhops': 0.0}, u'http://dbpedia.org/property/prarent': {'connections': 0.0, 'esrank': 23, 'sumofhops': 0.0}, u'http://dbpedia.org/property/theW': {'connections': 0.0, 'esrank': 22, 'sumofhops': 0.0}, u'http://dbpedia.org/ontology/Organisation': {'connections': 0.5, 'esrank': 7, 'sumofhops': 1.0}, u'http://dbpedia.org/property/parentOrganisation': {'connections': 0.0, 'esrank': 2, 'sumofhops': 0.0}, u'http://dbpedia.org/property/parentOrganization': {'connections': 0.0, 'esrank': 3, 'sumofhops': 0.0}, u'http://dbpedia.org/property/parents': {'connections': 0.0, 'esrank': 24, 'sumofhops': 0.0}, u'http://dbpedia.org/property/agent': {'connections': 0.0, 'esrank': 10, 'sumofhops': 0.0}, u'http://dbpedia.org/property/parentOraganisation': {'connections': 0.0, 'esrank': 4, 'sumofhops': 0.0}}, 2: {u'http://dbpedia.org/resource/Barack_Obama_Selma_50th_anniversary_speech': {'connections': 0.0, 'esrank': 13, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Economic_policy_of_Barack_Obama': {'connections': 0.0, 'esrank': 8, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Barack_Obama_Green_Charter_High_School': {'connections': 0.0, 'esrank': 31, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Assassination_threats_against_Barack_Obama': {'connections': 0.0, 'esrank': 4, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/United_States_Senate_career_of_Barack_Obama': {'connections': 0.0, 'esrank': 21, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Efforts_to_impeach_Barack_Obama': {'connections': 0.0, 'esrank': 12, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Invitations_to_the_first_inauguration_of_Barack_Obama': {'connections': 0.0, 'esrank': 9, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Barack_Obama_Tucson_memorial_speech': {'connections': 0.0, 'esrank': 17, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Barack_Obama,_Sr.': {'connections': 0.25, 'esrank': 22, 'sumofhops': 0.125}, u'http://dbpedia.org/resource/Barack_Obama_%22Hope%22_poster': {'connections': 0.0, 'esrank': 26, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Barack_Obama_presidential_campaign,_2008': {'connections': 0.0, 'esrank': 20, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/List_of_topics_related_to_Barack_Obama': {'connections': 0.0, 'esrank': 2, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Barack_Obama_%22Joker%22_poster': {'connections': 0.0, 'esrank': 3, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Foreign_policy_of_the_Barack_Obama': {'connections': 0.0, 'esrank': 14, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Illinois_Senate_career_of_Barack_Obama': {'connections': 0.0, 'esrank': 15, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Barack_Obama_in_comics': {'connections': 0.0, 'esrank': 24, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Barack_Obama': {'connections': 0.25, 'esrank': 1, 'sumofhops': 0.5}, u'http://dbpedia.org/resource/List_of_things_named_after_Barack_Obama': {'connections': 0.0, 'esrank': 18, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Native_American_Policy_of_the_Barack_Obama_Administration': {'connections': 0.0, 'esrank': 29, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Barack_Obama_Democratic_Club_of_Upper_Manhattan': {'connections': 0.0, 'esrank': 28, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Public_image_of_Barack_Obama': {'connections': 0.0, 'esrank': 7, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Barack_Obama_on_social_media': {'connections': 0.0, 'esrank': 23, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Second_inauguration_of_Barack_Obama': {'connections': 0.0, 'esrank': 16, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Barack_Obama_presidential_campaign_endorsements': {'connections': 0.0, 'esrank': 25, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Barack_Obama_Male_Leadership_Academy': {'connections': 0.0, 'esrank': 27, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Space_policy_of_the_Barack_Obama_administration': {'connections': 0.0, 'esrank': 11, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Presidential_transition_of_Barack_Obama': {'connections': 0.0, 'esrank': 6, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/First_inauguration_of_Barack_Obama': {'connections': 0.0, 'esrank': 19, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Timeline_of_the_presidency_of_Barack_Obama': {'connections': 0.0, 'esrank': 30, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/Barack_Obama_College_Preparatory_High_School': {'connections': 0.0, 'esrank': 10, 'sumofhops': 0.0}, u'http://dbpedia.org/resource/List_of_books_and_films_about_Barack_Obama': {'connections': 0.0, 'esrank': 5, 'sumofhops': 0.0}}, 3: {u'http://www.smh.com.au/business/property/old-is-new-at-refashioned-amp-square-20110522-1eytn.html': {'connections': 0.0, 'esrank': 24, 'sumofhops': 0.0}, u'http://www.news.com.au/money/property/mining-boom-is-strangling-heart-of-gunnedah/story-e6frfmd0-1226298825863': {'connections': 0.0, 'esrank': 28, 'sumofhops': 0.0}, u'http://dbpedia.org/property/causeIs': {'connections': 0.0, 'esrank': 11, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isSiSpecs': {'connections': 0.0, 'esrank': 30, 'sumofhops': 0.0}, u'http://dbpedia.org/property/theGovernorIs412YearsOfAgeAndHerNameIsEthelWinkleberryTimezone': {'connections': 0.0, 'esrank': 29, 'sumofhops': 0.0}, u'http://www.timeslive.co.za/sundaytimes/decor/property/2015/11/13/Real-estate-crowdfunding-is-unchartered-territory-in-SA': {'connections': 0.0, 'esrank': 27, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isBladed': {'connections': 0.0, 'esrank': 7, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isOn': {'connections': 0.0, 'esrank': 10, 'sumofhops': 0.0}, u'http://www.independent.co.uk/property/house-and-home/is-elmbridge-britains-beverly-hills-2190344.html': {'connections': 0.0, 'esrank': 22, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isMulti': {'connections': 0.0, 'esrank': 12, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isRanged': {'connections': 0.0, 'esrank': 6, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isRangedl': {'connections': 0.0, 'esrank': 15, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isTube': {'connections': 0.0, 'esrank': 21, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isUk': {'connections': 0.0, 'esrank': 5, 'sumofhops': 0.0}, u'http://www.telegraph.co.uk/property/overseasproperty/3360841/Caribbean-property-Rio-Ferdinand-is-ahead-of-the-game.html': {'connections': 0.0, 'esrank': 25, 'sumofhops': 0.0}, u'http://dbpedia.org/property/10,000IsADiceGameThatIsPlayedWithFiveDiceA': {'connections': 0.0, 'esrank': 2, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isThermal': {'connections': 0.0, 'esrank': 18, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isVehicle': {'connections': 0.0, 'esrank': 13, 'sumofhops': 0.0}, u'http://dbpedia.org/property/is': {'connections': 0.0, 'esrank': 1, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isMissile': {'connections': 0.0, 'esrank': 8, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isShip': {'connections': 0.0, 'esrank': 19, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isSeries': {'connections': 0.0, 'esrank': 4, 'sumofhops': 0.0}, u'http://dbpedia.org/property/remains': {'connections': 0.0, 'esrank': 31, 'sumofhops': 0.0}, u'http://www.telegraph.co.uk/property/9285761/Hovis-Hill-is-this-the-greatest-street-since-sliced-bread.html': {'connections': 0.0, 'esrank': 26, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isArtillery': {'connections': 0.0, 'esrank': 3, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isStack': {'connections': 0.0, 'esrank': 14, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isExplosive': {'connections': 0.0, 'esrank': 20, 'sumofhops': 0.0}, u'http://www.telegraph.co.uk/finance/property/3293690/When-an-Englishmans-home-is-his-business.html': {'connections': 0.0, 'esrank': 23, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isBomb': {'connections': 0.0, 'esrank': 9, 'sumofhops': 0.0}, u'http://dbpedia.org/property/isSeason': {'connections': 0.0, 'esrank': 16, 'sumofhops': 0.0}, u'http://dbpedia.org/property/featIs': {'connections': 0.0, 'esrank': 17, 'sumofhops': 0.0}}}, 'ertypes': ['entity', 'relation', 'entity', 'relation']}

ReRanker.py {0: 'correct'} {0: 'correct', 1: 'correct'} {0: 'correct', 1: 'correct', 2: 'correct'} {0: 'correct', 1: 'correct', 2: 'correct', 3: 'correct'} {'rerankedlists': {0: [(0.24673877656459808, u'http://dbpedia.org/resource/WHO-DT'), (0.1757771074771881, u'http://dbpedia.org/resource/Who%3F_(novel)'), (0.010780549608170986, u'http://dbpedia.org/resource/Girls_Who_Like_Boys_Who_Like_Boys_(book)'), (0.007336166687309742, u'http://dbpedia.org/resource/Who'), (0.007293460890650749, u'http://dbpedia.org/resource/Doctor_Who'), (0.005412636790424585, u'http://dbpedia.org/resource/The_Who'), (0.004728458821773529, u'http://dbpedia.org/resource/Who%3F_Who%3F_Ministry'), (0.0012683486565947533, u'http://dbpedia.org/resource/Who,_Me'), (0.0004659400146920234, u'http://dbpedia.org/resource/Yara-ma-yha-who'), (0.000256964034633711, u"http://dbpedia.org/resource/Who_I_Am_Hates_Who_I've_Been"), (0.0002468969614710659, u'http://dbpedia.org/resource/Who%3F_(album)'), (0.00024368573212996125, u'http://dbpedia.org/resource/Who,_What,_Wear'), (0.00023866206174716353, u'http://dbpedia.org/resource/WHO/PES'), (0.0002059761609416455, u'http://dbpedia.org/resource/Who_Covers_Who%3F'), (0.00015553012781310827, u'http://dbpedia.org/resource/Who_Made_Who_World_Tour'), (0.00015441636787727475, u'http://dbpedia.org/resource/Chi_(Who)'), (0.0001491083821747452, u'http://dbpedia.org/resource/Who%3F_(song)'), (0.0001226204476552084, u'http://dbpedia.org/resource/Who,_whom%3F'), (0.00011838225327664986, u'http://dbpedia.org/resource/Girls_Who_Like_Boys_Who_Like_Boys'), (0.00011634613474598154, u'http://dbpedia.org/resource/Who_Knows_Who'), (0.00011295441800029948, u'http://dbpedia.org/resource/Vem_\xe4r_det'), (6.297003710642457e-05, u'http://dbpedia.org/resource/Who_Cares'), (5.6966171541716903e-05, u'http://dbpedia.org/resource/Vinnie_Who'), (5.1916656957473606e-05, u'http://dbpedia.org/resource/Who_Made_Who'), (4.98787485412322e-05, u'http://dbpedia.org/resource/Who_Dunnit'), (4.9208945711143315e-05, u'http://dbpedia.org/resource/Ledipasvir'), (4.746868580696173e-05, u'http://dbpedia.org/resource/Who_Is_Dr_Who'), (4.603238994604908e-05, u'http://dbpedia.org/resource/Who_Booty'), (3.637570989667438e-05, u'http://dbpedia.org/resource/Who_Made_Who_(song)'), (3.637570989667438e-05, u'http://dbpedia.org/resource/Who_Killed_Who%3F'), (3.027915590791963e-05, u'http://dbpedia.org/resource/Who_Shall_Live_and_Who_Shall_Die')], 1: [(0.8148366212844849, u'http://dbpedia.org/ontology/parentOrganisation'), (0.022033773362636566, u'http://dbpedia.org/ontology/parent'), (0.01430449914187193, u'http://dbpedia.org/ontology/Organisation'), (0.0057295155711472034, u'http://dbpedia.org/property/parent'), (0.004728458821773529, u'http://dbpedia.org/property/parentOrganisation'), (0.0018422453431412578, u'http://dbpedia.org/property/parents'), (0.0014046295545995235, u'http://dbpedia.org/property/parentOrganization'), (0.0011621536687016487, u'http://dbpedia.org/property/parentOraganisation'), (0.000256964034633711, u'http://dbpedia.org/property/urbanisation'), (0.0002468969614710659, u'http://dbpedia.org/property/parentCo.'), (0.00024368573212996125, u'http://dbpedia.org/ontology/organisation'), (0.0002059761609416455, u'http://dbpedia.org/property/organisations'), (0.00015553012781310827, u'http://dbpedia.org/property/organization'), (0.00015441636787727475, u'http://dbpedia.org/property/organisation'), (0.0001491083821747452, u'http://dbpedia.org/property/parantOrganization'), (0.0001226204476552084, u'http://dbpedia.org/property/agent'), (0.00011838225327664986, u'http://dbpedia.org/property/theW'), (0.00011634613474598154, u'http://dbpedia.org/property/theA'), (0.00011295441800029948, u'http://dbpedia.org/property/prarent'), (5.1916656957473606e-05, u'http://dbpedia.org/property/theE'), (4.746868580696173e-05, u'http://dbpedia.org/property/organizations'), (4.603238994604908e-05, u'http://dbpedia.org/property/parnet'), (4.603238994604908e-05, u'http://dbpedia.org/property/perent'), (3.637570989667438e-05, u'http://dbpedia.org/property/organiztion'), (3.637570989667438e-05, u'http://www.telegraph.co.uk/finance/property/renting/11908002/Generation-rent-the-reluctant-rise-of-the-older-tenant.html'), (3.027915590791963e-05, u'http://dbpedia.org/property/theN')], 2: [(0.8188783526420593, u'http://dbpedia.org/resource/Barack_Obama'), (0.10043445974588394, u'http://dbpedia.org/resource/Presidential_transition_of_Barack_Obama'), (0.004728458821773529, u'http://dbpedia.org/resource/List_of_topics_related_to_Barack_Obama'), (0.0014046295545995235, u'http://dbpedia.org/resource/Barack_Obama_%22Joker%22_poster'), (0.0012683486565947533, u'http://dbpedia.org/resource/List_of_books_and_films_about_Barack_Obama'), (0.0011621536687016487, u'http://dbpedia.org/resource/Assassination_threats_against_Barack_Obama'), (0.0004659400146920234, u'http://dbpedia.org/resource/Efforts_to_impeach_Barack_Obama'), (0.000256964034633711, u'http://dbpedia.org/resource/Illinois_Senate_career_of_Barack_Obama'), (0.0002468969614710659, u'http://dbpedia.org/resource/Space_policy_of_the_Barack_Obama_administration'), (0.00023866206174716353, u'http://dbpedia.org/resource/Public_image_of_Barack_Obama'), (0.0002059761609416455, u'http://dbpedia.org/resource/Barack_Obama_Selma_50th_anniversary_speech'), (0.00017089983157347888, u'http://dbpedia.org/resource/Barack_Obama_in_comics'), (0.00015553012781310827, u'http://dbpedia.org/resource/Foreign_policy_of_the_Barack_Obama'), (0.00015441636787727475, u'http://dbpedia.org/resource/Economic_policy_of_Barack_Obama'), (0.0001491083821747452, u'http://dbpedia.org/resource/Invitations_to_the_first_inauguration_of_Barack_Obama'), (0.0001226204476552084, u'http://dbpedia.org/resource/Barack_Obama_College_Preparatory_High_School'), (0.00011838225327664986, u'http://dbpedia.org/resource/Barack_Obama,_Sr.'), (0.00011634613474598154, u'http://dbpedia.org/resource/United_States_Senate_career_of_Barack_Obama'), (0.00011295441800029948, u'http://dbpedia.org/resource/Barack_Obama_on_social_media'), (6.297003710642457e-05, u'http://dbpedia.org/resource/Native_American_Policy_of_the_Barack_Obama_Administration'), (5.6966171541716903e-05, u'http://dbpedia.org/resource/Barack_Obama_Democratic_Club_of_Upper_Manhattan'), (5.1916656957473606e-05, u'http://dbpedia.org/resource/Barack_Obama_presidential_campaign,_2008'), (4.98787485412322e-05, u'http://dbpedia.org/resource/Barack_Obama_Green_Charter_High_School'), (4.98787485412322e-05, u'http://dbpedia.org/resource/Timeline_of_the_presidency_of_Barack_Obama'), (4.9208945711143315e-05, u'http://dbpedia.org/resource/Barack_Obama_Male_Leadership_Academy'), (4.746868580696173e-05, u'http://dbpedia.org/resource/Second_inauguration_of_Barack_Obama'), (4.603238994604908e-05, u'http://dbpedia.org/resource/Barack_Obama_%22Hope%22_poster'), (4.603238994604908e-05, u'http://dbpedia.org/resource/Barack_Obama_presidential_campaign_endorsements'), (3.637570989667438e-05, u'http://dbpedia.org/resource/Barack_Obama_Tucson_memorial_speech'), (3.637570989667438e-05, u'http://dbpedia.org/resource/List_of_things_named_after_Barack_Obama'), (3.027915590791963e-05, u'http://dbpedia.org/resource/First_inauguration_of_Barack_Obama')], 3: [(0.007336166687309742, u'http://dbpedia.org/property/is'), (0.004728458821773529, u'http://dbpedia.org/property/10,000IsADiceGameThatIsPlayedWithFiveDiceA'), (0.0014046295545995235, u'http://dbpedia.org/property/isArtillery'), (0.0012683486565947533, u'http://dbpedia.org/property/isUk'), (0.0011621536687016487, u'http://dbpedia.org/property/isSeries'), (0.0004659400146920234, u'http://dbpedia.org/property/isMulti'), (0.000256964034633711, u'http://dbpedia.org/property/isRangedl'), (0.0002468969614710659, u'http://dbpedia.org/property/causeIs'), (0.00024368573212996125, u'http://dbpedia.org/property/isRanged'), (0.00023866206174716353, u'http://dbpedia.org/property/isBladed'), (0.0002059761609416455, u'http://dbpedia.org/property/isVehicle'), (0.00017089983157347888, u'http://www.smh.com.au/business/property/old-is-new-at-refashioned-amp-square-20110522-1eytn.html'), (0.00015553012781310827, u'http://dbpedia.org/property/isStack'), (0.00015441636787727475, u'http://dbpedia.org/property/isMissile'), (0.0001491083821747452, u'http://dbpedia.org/property/isBomb'), (0.0001226204476552084, u'http://dbpedia.org/property/isOn'), (0.00011838225327664986, u'http://www.independent.co.uk/property/house-and-home/is-elmbridge-britains-beverly-hills-2190344.html'), (0.00011634613474598154, u'http://dbpedia.org/property/isTube'), (0.00011295441800029948, u'http://www.telegraph.co.uk/finance/property/3293690/When-an-Englishmans-home-is-his-business.html'), (6.297003710642457e-05, u'http://dbpedia.org/property/theGovernorIs412YearsOfAgeAndHerNameIsEthelWinkleberryTimezone'), (5.6966171541716903e-05, u'http://www.news.com.au/money/property/mining-boom-is-strangling-heart-of-gunnedah/story-e6frfmd0-1226298825863'), (5.1916656957473606e-05, u'http://dbpedia.org/property/isExplosive'), (4.98787485412322e-05, u'http://dbpedia.org/property/isSiSpecs'), (4.98787485412322e-05, u'http://dbpedia.org/property/remains'), (4.9208945711143315e-05, u'http://www.timeslive.co.za/sundaytimes/decor/property/2015/11/13/Real-estate-crowdfunding-is-unchartered-territory-in-SA'), (4.746868580696173e-05, u'http://dbpedia.org/property/isSeason'), (4.603238994604908e-05, u'http://www.telegraph.co.uk/property/overseasproperty/3360841/Caribbean-property-Rio-Ferdinand-is-ahead-of-the-game.html'), (4.603238994604908e-05, u'http://www.telegraph.co.uk/property/9285761/Hovis-Hill-is-this-the-greatest-street-since-sliced-bread.html'), (3.637570989667438e-05, u'http://dbpedia.org/property/featIs'), (3.637570989667438e-05, u'http://dbpedia.org/property/isThermal'), (3.027915590791963e-05, u'http://dbpedia.org/property/isShip')]}, 'changes': {0: 'correct', 1: 'correct', 2: 'correct', 3: 'correct'}, 'chunktext': [{'chunk': 'Who', 'surfacelength': 3, 'class': 'entity', 'surfacestart': 0}, {'chunk': 'the parent organisation', 'surfacelength': 23, 'class': 'relation', 'surfacestart': 7}, {'chunk': 'Barack Obama', 'surfacelength': 12, 'class': 'entity', 'surfacestart': 34}, {'chunk': 'is', 'surfacelength': 2, 'class': 'relation', 'surfacestart': 4}], 'er-rerun': False, 'ertypes': ['entity', 'relation', 'entity', 'relation']}

ShallowParser.py [('Who', 'S-NP'), ('is', 'S-VP'), ('the', 'B-NP'), ('parent', 'I-NP'), ('organisation', 'E-NP'), ('of', 'S-PP'), ('Barack', 'B-NP'), ('Obama', 'E-NP'), ('?', 'O')] [[('Who', 'S-NP', 0, 3)], [('the', 'B-NP', 7, 3), ('parent', 'I-NP', 11, 6), ('organisation', 'E-NP', 18, 12)], [('Barack', 'B-NP', 34, 6), ('Obama', 'E-NP', 41, 5)], [('is', 'S-VP', 4, 2)]] [[('parent', 'I-NP', 11, 6), ('organisation', 'E-NP', 18, 12)], [('Barack', 'B-NP', 34, 6), ('Obama', 'E-NP', 41, 5)]] [[('parent', 'I-NP', 11, 6), ('organisation', 'E-NP', 18, 12)], [('Barack', 'B-NP', 34, 6), ('Obama', 'E-NP', 41, 5)]]

TextMatch.py [{u'chunk': {u'chunk': u'friend', u'surfacelength': 6, u'class': u'relation', u'surfacestart': 0}, u'topkmatches': [u'http://dbpedia.org/ontology/associate', u'http://dbpedia.org/ontology/patron', u'http://dbpedia.org/ontology/date', u'http://dbpedia.org/ontology/date', u'http://dbpedia.org/ontology/date', u'http://dbpedia.org/ontology/partner', u'http://dbpedia.org/ontology/associate', u'http://dbpedia.org/ontology/partner', u'http://dbpedia.org/ontology/partner', u'http://dbpedia.org/ontology/spouse', u'http://dbpedia.org/ontology/partner', u'http://dbpedia.org/ontology/date', u'http://dbpedia.org/ontology/Bird', u'http://dbpedia.org/ontology/partner', u'http://dbpedia.org/ontology/date', u'http://dbpedia.org/ontology/partner', u'http://dbpedia.org/ontology/spouse', u'http://dbpedia.org/ontology/partner', u'http://dbpedia.org/ontology/spouse', u'http://dbpedia.org/ontology/partner', u'http://dbpedia.org/ontology/child', u'http://dbpedia.org/ontology/associate', u'http://dbpedia.org/ontology/associate', u'http://dbpedia.org/ontology/collection', u'http://dbpedia.org/ontology/Tunnel', u'http://dbpedia.org/ontology/partner', u'http://dbpedia.org/ontology/partner', u'http://xmlns.com/foaf/0.1/familyName', u'http://xmlns.com/foaf/0.1/familyName', u'http://xmlns.com/foaf/0.1/surname'], u'class': u'relation'}]

debayan commented 4 years ago

Hi,

This is now what I am asking for. I want the output of just the window where you have run "python api.py 4999". Do not run scripts inidividually. And use the same question as you used initially: "Who is the president of USA?"

liviofreire commented 4 years ago

{u'nlquery': u'Who is the president of USA?'} [('Who', 'S-NP'), ('is', 'S-VP'), ('the', 'B-NP'), ('president', 'E-NP'), ('of', 'S-PP'), ('USA', 'S-NP'), ('?', 'O')] [[('Who', 'S-NP', 0, 3)], [('the', 'B-NP', 7, 3), ('president', 'E-NP', 11, 9)], [('USA', 'S-NP', 24, 3)], [('is', 'S-VP', 4, 2)]] [[('president', 'E-NP', 11, 9)], [('USA', 'S-NP', 24, 3)]] Chunks: [[["president", "E-NP", 11, 9]], [["USA", "S-NP", 24, 3]]] ('president', tensor([1., 0.], grad_fn=), tensor(1., grad_fn=)) ('USA', tensor([4.2536e-27, 1.0000e+00], grad_fn=), tensor(4.2536e-27, gradfn=)) ER Predictions: [{"chunk": "president", "surfacelength": 9, "class": "entity", "surfacestart": 11}, {"chunk": "USA", "surfacelength": 3, "class": "relation", "surfacestart": 24}] Top text matches: [{"chunk": {"chunk": "president", "surfacelength": 9, "class": "entity", "surfacestart": 11}, "topkmatches": ["http://dbpedia.org/resource/President", "http://dbpedia.org/resource/President's%22E%22_Award", "http://dbpedia.org/resource/Presidency", "http://dbpedia.org/resource/The_President", "http://dbpedia.org/resource/Chancellor_(education)", "http://dbpedia.org/resource/Pr\u00e9sident_(brand)", "http://dbpedia.org/resource/The_President_(1961_film)", "http://dbpedia.org/resource/The_Presidents_of_the_United_States_of_America_(band)", "http://dbpedia.org/resource/Speaker_(politics)", "http://dbpedia.org/resource/Carlo_Biotti", "http://dbpedia.org/resource/President_(card_game)", "http://dbpedia.org/resource/Sosai", "http://dbpedia.org/resource/Graisse", "http://dbpedia.org/resource/The_President_(2014_film)", "http://dbpedia.org/resource/Rector_(academia)", "http://dbpedia.org/resource/President's_Award", "http://dbpedia.org/resource/President_University", "http://dbpedia.org/resource/SS_President", "http://dbpedia.org/resource/President_of_India", "http://dbpedia.org/resource/President_of_Estonia", "http://dbpedia.org/resource/My_President", "http://dbpedia.org/resource/President_of_Abkhazia", "http://dbpedia.org/resource/The_Death_of_a_President", "http://dbpedia.org/resource/The_President's_Lady", "http://dbpedia.org/resource/President_of_Laos", "http://dbpedia.org/resource/President_of_Colombia", "http://dbpedia.org/resource/Presidents_and_Prophets", "http://dbpedia.org/resource/President_of_Yemen", "http://dbpedia.org/resource/Portrait_of_a_President", "http://dbpedia.org/resource/President_of_the_Government"], "class": "entity"}, {"chunk": {"chunk": "USA", "surfacelength": 3, "class": "relation", "surfacestart": 24}, "topkmatches": ["http://dbpedia.org/ontology/unitedStatesNationalBridgeId", "http://dbpedia.org/ontology/unitedStatesNationalBridgeId", "http://dbpedia.org/ontology/unitedStatesNationalBridgeId", "http://dbpedia.org/ontology/unitedStatesNationalBridgeId", "http://dbpedia.org/ontology/unitedStatesNationalBridgeId", "http://dbpedia.org/ontology/unitedStatesNationalBridgeId", "http://dbpedia.org/ontology/domain", "http://dbpedia.org/ontology/state", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/Country", "http://dbpedia.org/ontology/country", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom", "http://dbpedia.org/ontology/kingdom"], "class": "relation"}] ER link features: {"chunktext": [{"chunk": "president", "surfacelength": 9, "class": "entity", "surfacestart": 11}, {"chunk": "USA", "surfacelength": 3, "class": "relation", "surfacestart": 24}], "nodefeatures": {"0": {"http://dbpedia.org/resource/The_President's_Lady": {"connections": 0.0, "esrank": 24, "sumofhops": 0.0}, "http://dbpedia.org/resource/President": {"connections": 0.5, "esrank": 1, "sumofhops": 1.0}, "http://dbpedia.org/resource/President_of_Abkhazia": {"connections": 0.5, "esrank": 22, "sumofhops": 1.0}, "http://dbpedia.org/resource/The_President_(1961_film)": {"connections": 0.0, "esrank": 7, "sumofhops": 0.0}, "http://dbpedia.org/resource/The_Death_of_a_President": {"connections": 0.0, "esrank": 23, "sumofhops": 0.0}, "http://dbpedia.org/resource/President_University": {"connections": 1.0, "esrank": 17, "sumofhops": 1.25}, "http://dbpedia.org/resource/President_of_Laos": {"connections": 0.5, "esrank": 25, "sumofhops": 1.0}, "http://dbpedia.org/resource/Sosai": {"connections": 0.0, "esrank": 12, "sumofhops": 0.0}, "http://dbpedia.org/resource/The_President": {"connections": 1.0, "esrank": 4, "sumofhops": 1.25}, "http://dbpedia.org/resource/Portrait_of_a_President": {"connections": 0.0, "esrank": 29, "sumofhops": 0.0}, "http://dbpedia.org/resource/President_of_India": {"connections": 0.5, "esrank": 19, "sumofhops": 1.0}, "http://dbpedia.org/resource/Graisse": {"connections": 0.0, "esrank": 13, "sumofhops": 0.0}, "http://dbpedia.org/resource/President_of_Colombia": {"connections": 0.5, "esrank": 26, "sumofhops": 1.0}, "http://dbpedia.org/resource/President_of_Estonia": {"connections": 0.5, "esrank": 20, "sumofhops": 1.0}, "http://dbpedia.org/resource/The_Presidents_of_the_United_States_of_America_(band)": {"connections": 0.5, "esrank": 8, "sumofhops": 1.0}, "http://dbpedia.org/resource/The_President_(2014_film)": {"connections": 1.0, "esrank": 14, "sumofhops": 1.25}, "http://dbpedia.org/resource/President's_Award": {"connections": 0.0, "esrank": 16, "sumofhops": 0.0}, "http://dbpedia.org/resource/Presidents_and_Prophets": {"connections": 0.0, "esrank": 27, "sumofhops": 0.0}, "http://dbpedia.org/resource/Pr\u00e9sident_(brand)": {"connections": 0.0, "esrank": 6, "sumofhops": 0.0}, "http://dbpedia.org/resource/SS_President": {"connections": 0.0, "esrank": 18, "sumofhops": 0.0}, "http://dbpedia.org/resource/My_President": {"connections": 0.0, "esrank": 21, "sumofhops": 0.0}, "http://dbpedia.org/resource/Presidency": {"connections": 0.5, "esrank": 3, "sumofhops": 1.0}, "http://dbpedia.org/resource/President's_%22E%22_Award": {"connections": 0.0, "esrank": 2, "sumofhops": 0.0}, "http://dbpedia.org/resource/Speaker_(politics)": {"connections": 0.5, "esrank": 9, "sumofhops": 1.0}, "http://dbpedia.org/resource/Rector_(academia)": {"connections": 0.0, "esrank": 15, "sumofhops": 0.0}, "http://dbpedia.org/resource/President_(card_game)": {"connections": 0.0, "esrank": 11, "sumofhops": 0.0}, "http://dbpedia.org/resource/President_of_Yemen": {"connections": 0.5, "esrank": 28, "sumofhops": 1.0}, "http://dbpedia.org/resource/Carlo_Biotti": {"connections": 0.0, "esrank": 10, "sumofhops": 0.0}, "http://dbpedia.org/resource/President_of_the_Government": {"connections": 0.0, "esrank": 30, "sumofhops": 0.0}, "http://dbpedia.org/resource/Chancellor_(education)": {"connections": 0.0, "esrank": 5, "sumofhops": 0.0}}, "1": {"http://dbpedia.org/ontology/kingdom": {"connections": 0.0, "esrank": 9, "sumofhops": 0.0}, "http://dbpedia.org/ontology/country": {"connections": 1.5, "esrank": 24, "sumofhops": 0.75}, "http://dbpedia.org/ontology/state": {"connections": 0.0, "esrank": 8, "sumofhops": 0.0}, "http://dbpedia.org/ontology/Country": {"connections": 6.5, "esrank": 23, "sumofhops": 13.0}, "http://dbpedia.org/ontology/unitedStatesNationalBridgeId": {"connections": 0.0, "esrank": 1, "sumofhops": 0.0}, "http://dbpedia.org/ontology/domain": {"connections": 0.0, "esrank": 7, "sumofhops": 0.0}}}, "ertypes": ["entity", "relation"]} {0: 'correct'} Changing predictions for {u'chunk': u'USA', u'surfacelength': 3, u'class': u'relation', u'surfacestart': 24} {0: 'correct', 1: 'change'} Re-reanked lists: {"rerankedlists": {"0": [[0.5536420941352844, "http://dbpedia.org/resource/President"], [0.12900513410568237, "http://dbpedia.org/resource/Presidency"], [0.030404455959796906, "http://dbpedia.org/resource/The_President"], [0.02885913848876953, "http://dbpedia.org/resource/The_Presidents_of_the_United_States_of_America_(band)"], [0.012495358474552631, "http://dbpedia.org/resource/Speaker_(politics)"], [0.007223500870168209, "http://dbpedia.org/resource/President_of_Estonia"], [0.004728458821773529, "http://dbpedia.org/resource/President's_%22E%22_Award"], [0.004225569777190685, "http://dbpedia.org/resource/President_of_India"], [0.00378747028298676, "http://dbpedia.org/resource/President_of_Yemen"], [0.0036902434658259153, "http://dbpedia.org/resource/President_of_Abkhazia"], [0.003062719479203224, "http://dbpedia.org/resource/President_of_Laos"], [0.003062719479203224, "http://dbpedia.org/resource/President_of_Colombia"], [0.002289264462888241, "http://dbpedia.org/resource/The_President_(2014_film)"], [0.0021337049547582865, "http://dbpedia.org/resource/President_University"], [0.0012683486565947533, "http://dbpedia.org/resource/Chancellor_(education)"], [0.0004659400146920234, "http://dbpedia.org/resource/Sosai"], [0.000256964034633711, "http://dbpedia.org/resource/Rector_(academia)"], [0.0002468969614710659, "http://dbpedia.org/resource/President_(card_game)"], [0.00024368573212996125, "http://dbpedia.org/resource/Pr\u00e9sident_(brand)"], [0.00023866206174716353, "http://dbpedia.org/resource/The_President_(1961_film)"], [0.0002059761609416455, "http://dbpedia.org/resource/Graisse"], [0.00017089983157347888, "http://dbpedia.org/resource/The_President's_Lady"], [0.0001226204476552084, "http://dbpedia.org/resource/Carlo_Biotti"], [0.00011634613474598154, "http://dbpedia.org/resource/My_President"], [0.00011295441800029948, "http://dbpedia.org/resource/The_Death_of_a_President"], [6.297003710642457e-05, "http://dbpedia.org/resource/Portrait_of_a_President"], [4.98787485412322e-05, "http://dbpedia.org/resource/President_of_the_Government"], [4.9208945711143315e-05, "http://dbpedia.org/resource/Presidents_and_Prophets"], [4.746868580696173e-05, "http://dbpedia.org/resource/President's_Award"], [3.637570989667438e-05, "http://dbpedia.org/resource/SS_President"]], "1": [[0.01221555843949318, "http://dbpedia.org/ontology/country"], [0.01113790925592184, "http://dbpedia.org/ontology/Country"], [0.007336166687309742, "http://dbpedia.org/ontology/unitedStatesNationalBridgeId"], [0.00023866206174716353, "http://dbpedia.org/ontology/domain"], [0.00015441636787727475, "http://dbpedia.org/ontology/state"], [0.0001491083821747452, "http://dbpedia.org/ontology/kingdom"]]}, "changes": {"0": "correct", "1": "change"}, "chunktext": [{"chunk": "president", "surfacelength": 9, "class": "entity", "surfacestart": 11}, {"chunk": "USA", "surfacelength": 3, "class": "relation", "surfacestart": 24}], "er-rerun": true, "ertypes": ["entity", "relation"]}

debayan commented 4 years ago

The problem begins with ErPredictorES.py where your and mine outputs differ, Kindly send me the md5sum digests as below (on my system):

EARL$ md5sum data/er.model 51e5de052d3abb811d03c87620e08b80 data/er.model EARL$ md5sum scripts/ErPredictorES.py 14c574fc182120d09084fa02eab19bed scripts/ErPredictorES.py

liviofreire commented 4 years ago

EARL$ md5sum data/er.model 51e5de052d3abb811d03c87620e08b80 data/er.model EARL$ md5sum scripts/ErPredictorES.py 1994ecd8b8b4e7c1ee2cf1fb15d2fa16 scripts/ErPredictorES.py

Em seg., 17 de fev. de 2020 às 18:42, Debayan Banerjee < notifications@github.com> escreveu:

The problem begins with ErPredictorES.py where your and mine outputs differ, Kindly send me the md5sum digests as below (on my system):

EARL$ md5sum data/er.model 51e5de052d3abb811d03c87620e08b80 data/er.model EARL$ md5sum scripts/ErPredictorES.py 14c574fc182120d09084fa02eab19bed scripts/ErPredictorES.py

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AskNowQA/EARL/issues/20?email_source=notifications&email_token=ADZIJCIOZVVMHXWDOA6RHGLRDMAD3A5CNFSM4KVU37FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL7XR6A#issuecomment-587167992, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZIJCK4LK36J4YKU4HI2JLRDMAD3ANCNFSM4KVU37FA .

debayan commented 4 years ago

Ok clearly scripts/ErPredictorES.py is different for you and me. Kindly attach it. Please compare it to the file in github master branch right now and make sure you are using a latest version.

liviofreire commented 4 years ago

I changed the ftwv port to 8895, because port 8888 is busy. When I revert to 8888, md5sum is the same as yours:

EARL$ md5sum scripts/ErPredictorES.py 14c574fc182120d09084fa02eab19bed scripts/ErPredictorES.py

debayan commented 4 years ago

In ErPredictorES.py kindly add

print(x, type(x))

after the line

x = torch.FloatTensor(x)

and send me the output. I want to see if the input tensors differ for you and me.

For me they are as follows:

Chunks: [[["president", "E-NP", 11, 9]], [["USA", "S-NP", 24, 3]]] (tensor([ 2.7581e-03, -2.7358e-02, 2.5720e-02, 1.3282e-03, 2.6992e-02, -4.2305e-02, -2.1498e-02, -7.4508e-02, 1.6177e-02, 4.6760e-02, -3.3498e-02, 1.4972e-02, 4.6200e-02, 5.4470e-02, -4.0608e-02, 5.5233e-02, 3.6291e-02, -2.8464e-02, 2.5802e-02, 1.5939e-03, -9.0593e-04, 2.3883e-02, -9.5402e-04, 4.9699e-02, 1.9200e-02, 2.1633e-02, 2.5878e-02, 3.8650e-02, 5.4521e-04, -1.5656e-02, 1.3172e-02, -3.8050e-02, 8.6920e-03, 6.4634e-03, -6.0996e-02, 2.2191e-02, -1.1178e-02, 9.0404e-03, -3.6766e-02, 8.2480e-03, -6.9018e-02, -3.3375e-02, 3.4405e-02, 1.4260e-02, 2.3577e-02, 6.9977e-02, -8.1921e-03, 1.0117e-02, -2.2700e-02, 2.1276e-02, 5.3518e-02, -1.1449e-02, 1.5504e-02, 5.1681e-02, -5.2334e-03, -4.8824e-03, -6.3523e-02, -1.9994e-02, -2.2401e-02, 6.1401e-02, -6.4574e-02, 1.4169e-02, 8.8632e-02, -1.3735e-02, -1.4188e-02, 5.2882e-03, 1.0819e-02, -4.4569e-02, 5.8160e-02, -6.5855e-03, -2.0439e-02, -2.7281e-02, 4.5351e-02, -8.6411e-04, 4.4355e-03, 5.4922e-02, -4.5083e-02, 2.7981e-02, -5.1101e-02, 2.3783e-02, 1.5559e-02, 5.8319e-02, -1.8891e-02, 4.5233e-02, -1.4843e-02, -2.4955e-02, -5.4526e-02, -4.3669e-03, 1.5754e-02, -1.2583e-02, 2.8014e-02, 2.7778e-03, -1.0640e-01, -5.8137e-02, 2.4983e-02, 8.0351e-02, -2.4289e-02, 3.5388e-04, 5.3153e-02, 1.7788e-02, 2.9656e-02, 2.7412e-02, 6.9931e-02, -1.7902e-02, -6.3673e-02, -7.2545e-02, 2.3585e-03, -3.1222e-02, -4.0261e-02, 6.0544e-03, -6.5872e-02, 5.4715e-02, 5.1463e-02, 4.3608e-02, 5.4095e-02, 1.0022e-02, 1.4387e-02, 5.2456e-03, 2.4859e-02, 4.6325e-02, -1.2317e-02, -2.4058e-02, 3.1583e-02, 5.5294e-02, 8.7102e-03, 4.8347e-02, -1.1926e-02, -7.7441e-02, 8.2616e-03, 4.2897e-02, -1.9933e-02, 2.8177e-02, 9.5518e-03, 1.0884e-02, -2.2694e-02, 1.4544e-02, 3.9067e-02, 7.9892e-02, -3.9060e-03, 4.9529e-02, 1.6008e-02, -1.1670e-02, -1.1388e-02, -9.9050e-03, -4.9394e-04, 2.4360e-02, 1.5589e-02, 1.9048e-03, -2.3797e-02, 1.3096e-02, 2.7927e-02, 2.3669e-02, -1.4947e-02, -6.1210e-02, 4.1783e-02, -2.0013e-02, -2.2681e-02, 1.0905e-02, 3.3588e-03, 5.2717e-02, 3.9598e-02, 4.9666e-02, -1.3221e-02, -1.2843e-02, 2.0227e-03, -5.7685e-02, 1.5530e-02, -3.7176e-02, 6.6595e-03, -2.4164e-02, -2.9370e-03, -2.7764e-02, 1.0377e-02, 3.1736e-02, -2.8360e-02, 2.5528e-02, 2.2594e-02, 4.5883e-02, -2.6124e-02, 1.1824e-02, 3.4064e-02, 2.8218e-02, 3.7561e-02, -9.5311e-03, -1.2142e-02, -3.8712e-02, -4.9195e-03, 8.2119e-02, 3.9567e-02, -4.7928e-02, -3.1737e-02, 8.5531e-02, -5.5312e-02, -1.1059e-03, 7.5341e-04, -2.3311e-03, 3.1612e-02, -2.5641e-02, -3.2457e-02, -2.6912e-02, -1.0933e-01, 1.2116e-02, 6.1343e-02, -3.4017e-02, -1.8091e-02, -5.2806e-02, -3.3314e-02, -1.8785e-02, -1.0134e-01, -3.2236e-02, 9.3253e-02, 1.7353e-02, -6.7106e-03, 3.5711e-02, -9.6334e-02, -7.3926e-03, 5.3783e-03, -3.5631e-02, 5.5213e-02, 6.5959e-03, 6.8833e-03, 1.7779e-02, -2.1053e-02, 7.0089e-02, 3.3322e-02, 3.2127e-02, -1.0989e-02, 1.2219e-02, -1.7480e-02, -1.1521e-02, 2.2464e-02, -5.0237e-02, -1.2100e-02, -3.2644e-02, -2.8412e-02, -2.3694e-02, -2.1209e-02, -3.0980e-02, 2.4024e-02, -1.6744e-02, 1.0250e-01, -2.4411e-02, 7.2813e-03, 2.2577e-02, 1.1503e-02, 1.5837e-02, -1.0313e-02, -3.5918e-02, 8.2654e-03, -1.0200e-02, -1.1975e-02, 5.9897e-03, 1.2135e-02, 3.0792e-02, 6.3062e-02, 8.3421e-03, -3.9445e-02, 4.6470e-02, 2.9312e-02, -6.4939e-03, -1.4275e-02, 8.2152e-03, -1.1297e-02, 3.6768e-02, 3.1329e-02, 8.7405e-03, -1.4560e-02, 3.0116e-02, 4.0348e-03, 1.7311e-02, -1.7883e-02, 3.3459e-02, -1.0367e-01, -1.8293e-03, 4.2605e-03, -6.4447e-03, -1.7216e-02, 2.1769e-02, -8.1140e-03, -1.7255e-03, -1.8588e-02, 4.7505e-03, -4.1916e-02, 1.4314e-02, 3.9613e-02, -9.7177e-03, -3.2224e-02, -8.3408e-02, -3.0123e-02, -1.1110e-02, 4.3177e-03, 3.5356e-02, 4.9876e-02, 7.1889e-03, -1.2326e-02, 6.0704e-02, -5.6196e-02, -1.3705e-02, -1.6104e-02, 2.6946e-02, 1.5726e+01, 8.9000e-01, 8.9000e-01, 1.0000e+00]), <class 'torch.Tensor'>) ('president', tensor([0., 1.], grad_fn=), tensor(0., grad_fn=)) (tensor([ 3.5213e-02, 4.0480e-02, -5.4664e-02, 1.6090e-02, -1.6975e-02, -4.6089e-02, 3.3921e-03, -1.1813e-01, 7.8904e-02, -5.4774e-02, -3.6198e-02, -6.2896e-02, 1.3027e-01, -4.1682e-02, 4.0530e-02, 7.3085e-02, 8.8129e-02, -2.4844e-02, 5.0185e-02, -5.7895e-02, -8.8114e-02, 9.3057e-02, 4.4681e-02, 9.7354e-02, 1.3053e-02, 1.6197e-02, 1.6411e-02, -2.1701e-02, 4.6548e-02, 1.0876e-01, -9.7337e-02, -9.1580e-02, -9.7785e-03, 2.7857e-02, 9.2441e-02, 6.4609e-02, -2.6182e-02, -3.1732e-02, 1.5802e-02, 7.6951e-02, -4.0210e-02, 1.7522e-02, -2.2554e-02, -2.3433e-01, 1.2018e-01, 1.3493e-01, -2.5174e-02, -4.4475e-02, -1.9553e-03, 3.7004e-02, -7.1422e-02, 7.8189e-02, 5.4614e-02, 3.0064e-02, -1.0634e-01, 6.3365e-02, 7.6365e-02, 3.0885e-03, -1.0146e-01, -1.1685e-02, -2.8546e-02, 5.8263e-02, 2.8829e-02, -1.5301e-02, 3.2165e-02, -1.2983e-01, -7.5480e-02, -4.2340e-02, 9.8386e-02, -3.2320e-02, -4.3042e-02, 1.1188e-04, 4.7921e-02, -2.4113e-02, 3.5710e-02, -2.0396e-02, -3.0530e-02, 1.0155e-02, 4.7433e-02, -8.2623e-02, 6.3937e-02, 1.9739e-01, -3.8649e-02, 9.4816e-02, 6.8214e-02, 3.1383e-02, 5.1318e-03, -1.2421e-01, -5.8224e-03, -5.6909e-02, -3.6961e-02, -2.5039e-02, -6.4697e-02, 3.2340e-02, 8.1813e-03, 1.9788e-01, 1.5716e-02, -1.1360e-01, -5.7117e-02, -2.4988e-02, 7.9108e-02, 3.7696e-02, -8.8298e-03, -1.2361e-01, -6.5029e-03, -9.7884e-02, -7.3277e-02, 4.6702e-02, 1.3342e-01, 1.1128e-03, 6.2265e-02, 1.7518e-01, 3.8081e-02, 7.4566e-02, -1.2900e-02, -1.0617e-01, -1.0568e-01, -3.1538e-02, 1.1859e-01, 1.1638e-02, 6.1506e-02, 5.4831e-03, -7.5660e-02, -4.3945e-03, -1.5015e-01, -3.6698e-02, -3.4923e-02, -5.9217e-02, -2.2041e-02, 1.6157e-01, 6.8374e-03, 9.5466e-02, 6.1362e-02, -1.7581e-02, 4.3712e-03, -4.1945e-02, 1.2307e-01, -2.0219e-02, -1.0845e-01, -3.1378e-02, -6.8333e-03, 2.2676e-02, -4.5723e-02, 3.7344e-02, -7.4216e-02, 7.2890e-02, 1.0261e-02, -1.7663e-02, 5.0542e-02, -1.6693e-01, 4.0196e-02, 4.7195e-02, -4.0397e-02, 6.4070e-03, 1.0821e-03, 5.0252e-02, -8.3333e-02, -3.7843e-02, 1.1959e-01, -8.5509e-02, -2.1397e-02, -4.6667e-02, -1.1317e-02, -3.0046e-02, -8.5169e-02, 1.1962e-02, 2.3605e-02, 3.3454e-02, -3.0237e-03, -8.1962e-02, -3.5802e-02, 9.4036e-02, -1.0166e-02, -7.8746e-03, -1.9164e-01, 6.5795e-02, 1.3106e-02, 4.8175e-02, 1.4620e-02, 1.1276e-01, -3.6996e-03, 3.4349e-02, 4.4877e-02, -2.5283e-02, 3.9110e-02, 9.3031e-02, 2.1457e-02, 2.2363e-01, 2.0346e-02, -2.6715e-02, 1.3338e-01, 1.4461e-01, -1.5512e-01, -1.1405e-01, 6.0490e-02, -5.8528e-02, -2.8953e-02, 1.7702e-02, 5.2711e-02, 2.2575e-02, -1.1457e-01, 4.4748e-02, 3.4036e-03, -1.9884e-02, 3.0585e-02, -1.0130e-01, -2.2477e-03, -1.0811e-01, -3.5008e-03, -6.9452e-02, 1.7229e-01, -7.4234e-02, 2.5137e-03, -2.4706e-02, -3.0159e-02, -8.9754e-02, 5.3759e-02, -4.0572e-02, 1.3203e-01, -7.5584e-02, -8.6413e-02, -1.1494e-01, -1.3594e-02, 1.4515e-01, -1.3652e-01, 8.8382e-02, -2.1011e-02, 5.3842e-03, -1.2325e-01, 2.1273e-02, 6.6067e-02, -1.4159e-01, -1.1626e-01, -5.4752e-02, 1.6171e-03, -4.8540e-02, 1.2479e-01, 4.3802e-02, 2.9279e-02, -5.1033e-02, 1.3159e-01, -6.0341e-02, 8.6247e-02, -3.9078e-02, 2.1016e-01, -1.2632e-01, 5.6689e-02, 3.6541e-02, 3.3825e-02, -1.0784e-02, 7.7984e-02, -9.4503e-03, -4.5682e-02, 4.6589e-02, -4.7367e-03, 6.5157e-02, 1.6358e-02, 3.2876e-02, 9.9681e-02, 3.6796e-03, -1.7110e-02, 2.1075e-03, 4.5036e-02, -6.1519e-02, 1.7306e-02, -8.7910e-02, 5.9262e-02, 1.8904e-02, 7.5558e-02, 4.3512e-02, -6.0840e-02, 1.4715e-01, -6.4520e-02, 8.9885e-02, 1.1929e-02, -1.3007e-01, -4.9019e-02, 5.3166e-02, -3.4164e-02, 2.5539e-02, -1.4878e-01, 1.3396e-01, 9.5110e-03, 7.0821e-02, -4.5252e-02, -2.3783e-02, 9.2602e-03, -2.0746e-01, 3.2380e-02, 2.9777e-02, 1.7394e-02, -6.0086e-02, 1.5843e-01, 7.7792e-02, -3.8818e-03, -1.0371e-01, -8.5540e-03, -2.6067e-02, -4.5219e-02, 5.5877e-02, 1.6889e+01, 8.6000e-01, 1.0000e+00, 8.6000e-01]), <class 'torch.Tensor'>)

liviofreire commented 4 years ago

Chunks: [[["president", "E-NP", 11, 9]], [["USA", "S-NP", 24, 3]]] (tensor([-2.3891e-01, -5.6039e-01, 2.0238e-01, -2.1230e-01, -1.7558e-01, -6.6670e-02, -3.9479e-02, -6.9313e-01, -9.6966e-02, 4.4880e-01, 1.3446e-01, 2.4733e-01, -5.1936e-02, -1.8872e-02, -1.4386e-01, -1.8445e-01, 1.1567e-01, -3.2251e-01, 8.5613e-02, 4.3246e-01, -2.5654e-01, 1.6045e-01, -2.9686e-01, 3.0726e-02, 2.9325e-01, 5.6795e-03, 1.1267e-01, -2.7184e-01, -3.9202e-01, -9.9502e-02, 8.7148e-02, 1.4789e-01, -7.3770e-02, -3.6254e-01, -1.8827e-01, -4.2856e-01, 3.8760e-01, -6.7810e-02, 2.1933e-01, 1.4580e-01, -1.2327e-01, 1.5852e-01, -6.7444e-02, -5.8679e-02, 7.2984e-02, -2.5130e-01, -1.0307e-01, 1.9918e-01, 5.6438e-02, 8.1865e-02, 4.3621e-02, 1.9456e-01, -1.6866e-01, -1.0283e-01, 7.9163e-02, -4.9301e-01, 9.0072e-02, 2.3818e-01, 1.7602e-01, 2.4047e-01, 5.3837e-02, 1.9258e-01, -4.4273e-02, -2.5151e-01, -2.6193e-02, -7.0106e-02, 2.4506e-01, -2.7362e-01, 1.0200e-01, -5.8025e-03, -2.7124e-01, -7.7879e-02, 1.2879e-01, -1.8345e-01, -5.3856e-01, -1.3068e-01, 1.6154e-02, 3.5344e-02, -1.0618e-01, 1.9870e-01, 8.6383e-02, 3.0551e-02, -2.7143e-02, 4.7979e-02, 8.9525e-03, -1.5483e-01, -1.8935e-02, 3.7907e-02, 2.7183e-01, -2.9540e-02, 2.9984e-02, -2.6456e-01, 5.8718e-01, -2.4351e-01, 1.2134e-01, 2.5726e-01, 6.6595e-02, 5.0667e-02, -4.2266e-01, -3.9178e-04, 1.0654e-01, 2.8250e-01, 2.4376e-01, -1.6030e-01, 2.1824e-02, 4.9314e-01, -2.4751e-02, -2.0828e-01, 2.8937e-01, -1.3743e-01, -1.0370e-01, -2.9366e-01, -1.5850e-01, -3.3378e-01, -3.2307e-01, 2.2659e-01, 1.1760e-01, 2.4868e-01, 1.8222e-02, 1.7476e-01, -2.8208e-01, 1.0813e-01, 3.3985e-02, 5.9800e-01, 1.4674e-01, 1.0785e-01, -2.3068e-02, 9.2028e-02, -1.0063e-01, -3.5744e-02, -1.6311e-01, 5.9350e-02, -2.2703e-01, -2.5051e-01, 3.2548e-01, 2.2702e-01, 3.2781e-02, -2.0284e-01, -5.8914e-02, 3.8451e-01, 5.1068e-02, 4.2988e-01, -4.5495e-01, 1.2680e-01, -1.0467e-01, 6.4004e-01, 3.6746e-01, -7.5987e-02, -8.1306e-02, 3.8553e-02, 3.3521e-01, 3.4570e-02, 6.5262e-02, 2.0805e-01, -4.1977e-01, -6.7133e-02, -2.9556e-01, -1.9409e-01, 2.5092e-01, 4.4492e-01, 1.0200e-01, 3.9998e-01, -3.1469e-01, 1.7883e-01, 7.0639e-01, 2.0625e-01, 6.8834e-02, 3.0847e-01, -9.0990e-02, 3.3602e-02, 3.9479e-02, -4.8574e-02, -4.0505e-01, -1.4792e-01, -5.3600e-01, 3.1504e-01, 1.5622e-02, 7.4258e-02, -5.8345e-01, -6.7350e-02, -1.5859e-01, 1.2417e-01, -5.3071e-01, -3.8856e-02, 1.2910e-01, 6.4817e-01, -5.3768e-01, -4.0932e-01, 2.3969e-01, 6.5432e-02, -5.7145e-02, 1.2704e-01, -7.7836e-02, 7.9251e-02, -1.8393e-01, 2.3061e-01, 1.3345e-01, -5.4056e-01, 1.9424e-01, 8.8494e-02, 1.0738e-02, 2.6877e-02, 1.2261e-01, 4.1308e-02, -2.1562e-01, -4.4154e-01, 8.7936e-03, -1.9914e-01, 4.9461e-01, 2.0089e-01, 5.4900e-01, -5.1453e-02, 1.8239e-01, -8.1047e-02, 5.0739e-02, 1.3819e-01, 3.0007e-01, -2.3156e-01, 1.4211e-01, 3.2554e-01, -3.8790e-01, -1.0999e-01, -2.0584e-01, 1.9280e-01, 2.6804e-02, 6.7498e-02, -1.8635e-01, -3.6342e-01, 5.5142e-02, -6.0460e-01, 1.4885e-01, 5.1113e-01, 3.6255e-01, -2.0307e-01, -1.8265e-01, 1.9334e-01, -5.8108e-02, -3.0933e-01, 2.7359e-02, -7.1856e-01, -1.2821e-01, -4.9083e-02, -1.8480e-01, -2.3801e-01, -1.0596e-01, 2.6716e-01, 3.8345e-02, 8.3681e-02, -1.0633e-01, -4.3381e-01, 2.8787e-01, -1.8027e-01, -4.4656e-02, 2.7717e-01, 4.0731e-02, -6.7583e-03, -3.7939e-01, -8.0440e-02, -1.1399e-01, 2.5716e-01, 2.7767e-01, 2.5275e-01, 2.5765e-01, -2.1963e-01, -1.9251e-01, 1.2953e-02, 4.9677e-01, 2.9527e-02, 2.9254e-01, 2.3684e-01, -1.6703e-01, -2.2704e-01, -3.7692e-01, 8.9391e-02, -3.2946e-01, -4.8157e-01, 4.1476e-02, 3.7152e-01, 2.1897e-01, -2.4217e-01, -2.7473e-01, 3.4262e-02, 2.8092e-01, 1.5770e-01, 1.7031e-01, 3.0690e-01, 2.3618e-01, -1.4248e-01, -6.5235e-02, 2.2413e-02, -3.6419e-03, 5.1884e-02, 1.0634e-01, 2.1418e-02, -3.6580e-02, -2.8131e-01, 6.1604e-02, -6.1698e-02, -2.0273e-01, -7.4417e-02, 1.1705e+01, 8.9000e-01, 8.9000e-01, 1.0000e+00]), <class 'torch.Tensor'>)

('president', tensor([1., 0.], grad_fn=), tensor(1., grad_fn=)) (tensor([ 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 12.5712, 0.8600, 1.0000, 0.8600]), <class 'torch.Tensor'>)

debayan commented 4 years ago

Please try and download fasttext-wiki-news-subwords-300.tgz from https://drive.google.com/file/d/1IEkWGq89bc2UgWj--JkxOKztjXxxjkec/view?usp=sharing. Save it to data/ folder and unzip it. Kindly replace any older version of this file you may have with you. After that, restart TextMatchServer.py and try again and send me the results. Thanks for your patience.

liviofreire commented 4 years ago

I didn't get same results as yours (LIVE API), but now the results seems coherent:

curl -XPOST 'localhost:4999/processQuery' -H 'Content-Type: application/json' -d"{\"nlquery\":\"Who is the president of USA?\"}" {"rerankedlists": {"0": [[0.943970263004303, "http://dbpedia.org/ontology/president"], [0.1383364498615265, "http://dbpedia.org/ontology/President"], [0.012252113781869411, "http://dbpedia.org/ontology/leader"], [0.010219598188996315, "http://dbpedia.org/ontology/chairman"], [3.637570989667438e-05, "http://dbpedia.org/ontology/dean"]], "1": [[0.18003274500370026, "http://dbpedia.org/resource/Union_of_South_Africa"], [0.1509205549955368, "http://dbpedia.org/resource/United_States"], [0.07301211357116699, "http://dbpedia.org/resource/United_States_Army"], [0.007336166687309742, "http://dbpedia.org/resource/USAS"], [0.004728458821773529, "http://dbpedia.org/resource/United_States_Antarctic_Program"], [0.0014046295545995235, "http://dbpedia.org/resource/USA_Network"], [0.0004659400146920234, "http://dbpedia.org/resource/Conference_USA"], [0.000256964034633711, "http://dbpedia.org/resource/USA-38"], [0.0002468969614710659, "http://dbpedia.org/resource/Plumrose_USA"], [0.00024368573212996125, "http://dbpedia.org/resource/Ushas"], [0.0002059761609416455, "http://dbpedia.org/resource/USA-156"], [0.00017089983157347888, "http://dbpedia.org/resource/Icelandic_USA"], [0.00015553012781310827, "http://dbpedia.org/resource/Hainbach_(Usa)"], [0.00015441636787727475, "http://dbpedia.org/resource/USA-247"], [0.0001491083821747452, "http://dbpedia.org/resource/IDroid_USA"], [0.0001226204476552084, "http://dbpedia.org/resource/USA-92"], [0.00011838225327664986, "http://dbpedia.org/resource/USA-1"], [0.00011634613474598154, "http://dbpedia.org/resource/McFarland,_USA"], [0.00011295441800029948, "http://dbpedia.org/resource/USA_Trains"], [6.297003710642457e-05, "http://dbpedia.org/resource/USA-96"], [5.6966171541716903e-05, "http://dbpedia.org/resource/Fatherhood_USA"], [5.1916656957473606e-05, "http://dbpedia.org/resource/USA-221"], [4.98787485412322e-05, "http://dbpedia.org/resource/USA-126"], [4.9208945711143315e-05, "http://dbpedia.org/resource/Entertainment_USA"], [4.746868580696173e-05, "http://dbpedia.org/resource/USA-248"], [4.603238994604908e-05, "http://dbpedia.org/resource/USA_Broadcasting"], [4.603238994604908e-05, "http://dbpedia.org/resource/Hands_On_USA"], [3.637570989667438e-05, "http://dbpedia.org/resource/CSRWire_USA"], [3.637570989667438e-05, "http://dbpedia.org/resource/Folkmoot_USA"], [3.027915590791963e-05, "http://dbpedia.org/resource/USA_76"]]}, "changes": {"0": "correct", "1": "correct"}, "chunktext": [{"chunk": "president", "surfacelength": 9, "class": "relation", "surfacestart": 11}, {"chunk": "USA", "surfacelength": 3, "class": "entity", "surfacestart": 24}], "er-rerun": false, "ertypes": ["relation", "entity"]}

Thanks a lot for the help!

debayan commented 4 years ago

Ok, so it is clear that the mistake was at my end in the install instructions. i am correcting it now in the next git push to master branch. Thanks for letting me know about this issue.

nimo21 commented 4 years ago

Hi @liviofreire, I'm also trying to set up this code. Did you re-trained the pre-trained model (rdf2vec) mentioned in ent_rel_predictor.py script?