uvacw / inca

24 stars 6 forks source link

ported legacy verify.py to processor #345

Closed damian0604 closed 6 years ago

damian0604 commented 6 years ago

I ported the old verify.py so that it can be used as a processor within INCA and that it also accepts multiple questions to annotate. Example usage (assuming an elasticsearch instance is running and there are at least some nu articles in the database):

from inca import Inca
myinca = Inca()

p = myinca.processing.annotate(docs_or_query='nu',field='text',highlight_regexp = 'hij',new_key='myproject', questions={'relevant':'Is dit relevant?'})

data = next(p)

(this annotates only one article and returns the result as a dict called data)