google-research / tapas

End-to-end neural table-text understanding models.
Apache License 2.0
1.15k stars 217 forks source link

How do I add tapas into requirement.txt in Flask project? means I want to just add it in that file and use inside the Flask project. Kindly please help me on this. Thank you! #80

Closed vijayakumarmariyappan closed 4 years ago

vijayakumarmariyappan commented 4 years ago

How do I add tapas into requirement.txt in Flask project? means I want to just add it in that file and use inside the Flask project. Kindly please help me on this. Thank you!

I have a Flask web server. I like to integrate tapas into that server. How do i do that? what is the proper way to do it. Thank you for your time and help :+1:

ghost commented 4 years ago

Hi!

So far we didn't have a pip package you could easily install so there was no easy way to do that.

We just pushed version 0.0.1-dev:

https://pypi.org/project/tapas-table-parsing/0.0.1.dev0/

You should be able to add tapas-table-parsing==0.0.1.dev to your requirements.txt.

Does that work?

vijayakumarmariyappan commented 4 years ago

@thomasmueller-google

Thank you so much for your quick help.I will update you by tomorrow.. Thanks for your time 👍

vijayakumarmariyappan commented 4 years ago

@thomasmueller-google We tried it, but it seems not easy. It was throwing some errors. It would be nice, if we could just add it into requirements.txt then import into the code and use/predict.(after downloading model). But we integrated in other way like installing with folder. Anyhow thank you so much for your quick response and help :) In case of you have idea as I explained, will be great to everybody :) cheers dude :1st_place_medal:

ghost commented 4 years ago

Happy to help!

If you can paste the error messages here we can see if there is an easy fix. Maybe you can also provide a notebook to reproduce the issue?

vijayakumarmariyappan commented 4 years ago

@thomasmueller-google So kind of you. Our project has few other dependencies/libraries. I hope it was throwing error. I have not integreted into the fresh Flask project. I hope it will work fine.

But we would like to know/catch when the tapas unable to answer, so that we can return a specify message to user. Similar to try catch in python, like to catch when tapas unable to answer the question.

So we will have 2 cases,

  1. Tapas has given answer to the question. But it may or may not correct. Any confidence score available? for each answer that gives? So that by using confidence score, we can decide that tapas gives correct answer or not.
  2. While I ask invalid question to the tapas, it unable to give any answer, in that case, it returns empty. I check for empty result then return "Unable to answer your question". Is this correct procedure to do so. Or any other better way to capture this case.

Kindly please help us. Thank you so much :) Thank you for your time @thomasmueller-google

eisenjulian commented 4 years ago

Hello @vijayakumarmariyappan as it happens with many deep learning models, there's not an easy way to measure uncertainty in the predictions, and we haven't experimented too much in this space. One idea is too use the score of the selected tokens, which you can find in the probabilities in the model output. Another option could be to something like https://arxiv.org/abs/1506.02142 and apply dropout several times at inference time and average the results. That would require some small changes in the code (_get_classification_outputs in tapas_classifier_model.py and create_model in table_bert.py)

ghost commented 4 years ago

Closing for now since the original issue seems fixed. Feel free to reopen if there are some open questions.