machinalis / iepy

Information Extraction in Python
BSD 3-Clause "New" or "Revised" License
906 stars 186 forks source link

How to predict? #93

Closed leeapi2014 closed 8 years ago

leeapi2014 commented 8 years ago

When I labeled some evidences and ran the active learning core by _python bin/iepy_runner.py _ It seemed the prediction didn't work for all evidences. For example, I have 100 evidences and label 20 evidences, the output only contains prediction for those 20 evidences.

j0hn commented 8 years ago

Sorry for the late response.

This might be a bug. I ran a quick experiment and i think i spotted it but haven't got enough time to keep debugging it. I have some kind of fix but it would be really useful if you could test it and tell me if really fixes the problem.

To test it you could either

a) download this branch where i have commited the fix, install that version of IEPY and try again. b) make a slight change on one of your app's files and re-run the predictor. The change need to be done on the file bin/iepy_runner.py on the line 121 where it says

candidates = CandidateEvidenceManager.candidates_for_relation(relation) should say candidates = list(CandidateEvidenceManager.candidates_for_relation(relation))

I hope it helps and i'll keep an eye on this, thanks

jmansilla commented 8 years ago

Thanks @j0hn for discovering the bug.

I'll prefer not to make an in-memory list of all the candidates, and instead re-create the "cadidates generator"

jmansilla commented 8 years ago

Fix included on latest release