Your semantic data-based assistant aka Tell me FANDOM, ...
someone
born?episode
?episode
?foo
played in bar
episode?foo
Season 2
stories>>> rrp.simple_parse("Was Jake Simmonds in the Doctor Who cast?")
'(S1 (SQ (VBD Was) (NP (NP (NNP Jake) (NNPS Simmonds)) (PP (IN in) (NP (DT the) (NN Doctor)))) (NP (WP Who) (NN cast)) (. ?)))'
>>> rrp.simple_parse("Tell me something about foo")
'(S1 (S (VP (VB Tell) (NP (PRP me)) (NP (NP (NN something)) (PP (IN about) (NP (NN foo)))))))'
$ python ask.py "Who played Lionel Carson?"
Model directory: /home/macbre/.local/share/bllipparser/WSJ-PTB3
Model directory already exists, not reinstalling
INFO:get_oracle:Parsing question: Who played Lionel Carson?
INFO:get_oracle:Parsed question: [('WP', 'Who'), ('VBD', 'played'), ('NP', 'Lionel Carson')]
INFO:PersonFactOracle:You've asked: 'Who played Lionel Carson?' ({'name': 'Lionel Carson', 'property': 'played'})
INFO:PersonFactOracle:Asking SMW for 'Lionel Carson' page Actor property
INFO:PersonFactOracle:Got the value for Actor: ['Peter Bowles']
---
Who played Lionel Carson?
Lionel Carson is played by Peter Bowles.
Run make server
to start it. Flask server will listen on 0.0.0.0:5050
.
/ask
$ curl -s 'http://127.0.0.1:5050/ask?q=Who%20directed%20The%20Big%20Bang%20episode?' | jq
{
"_intent": "EpisodeFactIntent",
"_meta": {
"answer": "Toby Haynes",
"name": "The Big Bang episode",
"property": "directed"
},
"_reference": null,
"_words": {
"NN": "episode",
"NP": "The Big Bang episode",
"VBD": "directed",
"WP": "Who"
},
"answer": "\"The Big Bang episode\" episode has been directed by Toby Haynes."
}
/examples
$ curl -s 'http://127.0.0.1:5050/examples' | jq
{
"questions": [
"Where does Lionel Messi play?",
"Which club Cristiano Ronaldo plays for?",
"Which faction does the Alterac belong to?",
"Who directed The Big Bang episode?",
"Who played Jake Simmonds?"
]
}
person name
- https://poznan.fandom.com/api.php?action=browsebysubject&subject=Karol_Libeltyear
- https://poznan.fandom.com/api.php?action=ask&query=[[Born::1800]]|%3FBorn_in|sort%3DModification%20date|order%3Ddescvirtualenv env -ppython3
. env/bin/activate
pip install -r requirements.txt
make server