asknowqa / earl Goto Github PK
View Code? Open in Web Editor NEWEntity And RELation mapping
License: GNU General Public License v3.0
Entity And RELation mapping
License: GNU General Public License v3.0
Hi,
We were using the earl API a lot lately (last time yesterday). Since today the api seems to be down. https://earldemo.sda.tech/ isnt' working as well. Somehow we get redirected to http://sda.cs.uni-bonn.de/earl/api/processQuery but i think there are some issues with the CORS.
thank you
Silvan
Hi
I appreciate if u can answer my question.
I want to find the entities/relation of a KG which are related to natural questions. Accoutring to the paper, I think its solution will accomplish my goal!
Does this code work with any KG (e.g. a subset of Freebase)? Does it take a list of questions and a KG and return the correspond entities for each question?
Hi, I am working to include EARL in the AskNow system for German lanaguage, we managed to dockerize it, but then running it i am getting a nasty error, if you can point out what is the issue it would be great.
/usr/local/lib/python2.7/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
2018-03-22 15:41:15.532710: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
[2018-03-23 14:42:43,551] ERROR in app: Exception on /processQuery [POST]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/app//EARL/scripts/api.py", line 76, in processQuery
erpredictions = e.erPredict(chunks)
File "/app/EARL/scripts/ErPredictor.py", line 62, in erPredict
chunkwords = chunk[0].translate(None, string.punctuation)
TypeError: translate() takes exactly one argument (2 given)
::ffff:129.26.77.49 - - [2018-03-23 14:42:43] "POST /processQuery HTTP/1.1" 500 412 0.011473
[2018-03-23 14:48:27,905] ERROR in app: Exception on /processQuery [POST]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/app//EARL/scripts/api.py", line 76, in processQuery
erpredictions = e.erPredict(chunks)
File "/app/EARL/scripts/ErPredictor.py", line 62, in erPredict
chunkwords = chunk[0].translate(None, string.punctuation)
TypeError: translate() takes exactly one argument (2 given)
::ffff:129.26.77.49 - - [2018-03-23 14:48:27] "POST /processQuery HTTP/1.1" 500 412 0.008723
Do you have any advice on generating sparql query from the resulting ER respose?
{
"entities": [
{
"uris": [
{
"confidence": 0.8497507038000123,
"uri": "http://dbpedia.org/resource/Amnesty_International_USA"
}
],
"surface": [
28,
53
]
}
],
"question": "Where is the headquarter of Amnesty International USA",
"relations": [
{
"uris": [
{
"confidence": 0.3996484675519773,
"uri": "http://dbpedia.org/ontology/headquarter"
}
],
"surface": [
13,
24
]
}
]
}
I was looking at lcquad.json
. Can that training data be used to train a model ?
We use EARL as a relation linker in our QA Pipeline. During tests we noticed that we get different results for the same question. We are using the ranked option of the API.
On 29.4.2019 we asked following question: "Who is the daughter of Bill Clinton married to?"
The result was for:
Daughter: "http://dbpedia.org/ontology/child"
Married: "http://dbpedia.org/ontology/spouse"
Today we asked the same question again and get the result:
Daughter: "http://dbpedia.org/ontology/child"
Married: "http://dbpedia.org/ontology/partner"
What could be the cause of this. Have there been updates to the server or how can we explain this difference?
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?
How do you differentiate between
Where was Barack Obama born
and When was Barack Obama born
In the latter the predicate born
is birthDate
and not birthPlace
. Using answer type (in this case Date) as one of the training feature for ER Predictor may solve this issue?
Hi,Thank you for your code.But I found when the chunk is predicted as relation,ontologylabeluridict can just help to find candidat uri under http://dbpedia.org/ontology/,so how do we handle the chunks that might link to uri under http://dbpedia.org/property/
Hii
Is the code for GTSP solver and adaptive learning open source. Also where can i find code to train my own ER predictor model?. Please let me know.
Hi could you share the elastic search mapping you are using for dbpredicateindex14
and dbentityindex9
indexes.
What import/export script are you using ?
NLTK is missing from dependencies.txt
Hi, Love the work you guys are doing. And this is a wonderful piece of code.
I have been playing with the code, and was wondering if you are planning to publish the training files and data, especially ER Prediction, Reranker
An issue i find is ER Prediction is sensitive to text casing. If i type who is the president of usa
, it classifies usa as a relation
. Is this is a fixable problem?
Thanks again
I tried to use the API provided in the Readme file but it doesn't seem to work and returns 502 bad gateway.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.