machinalis / iepy

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

Is it possible use IEPY as a service? #124

Open himarora opened 7 years ago

himarora commented 7 years ago

IEPY is good for bulk operations, but my requirement is to get the answer as soon as possible on per request basis which can be simultaneous as well. One approach is:

  1. Get the document id and text from the HTTP request.
  2. Create a temporary csv file with a unique name.
  3. Import that file into iepy using csv_to_iepy.py.
  4. Run preprocess.py.
  5. Predict the output using an already trained pickle model file.
  6. Get the candidate_relation_id from the output csv.
  7. Get further details, such as alias from the db.
  8. Clear the temporary files and db tables.

Now the clearing part is not allowing it to be a concurrent system. If I don't clear the db, it checks if all the steps have been done for previous documents as well.

jmansilla commented 7 years ago

Hi!

I think that what you are wanting to do is very related with this other ticket: https://github.com/machinalis/iepy/issues/62

So, the short answer is "no, cannot be done out of the box", but if you follow a bit the discussion on that thread, should be possible to do the needed changes. Want to make a try?