-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building docker image #35
Comments
The reason why we need AllenNLP in TNER is because AllenNLP provides the CRF, which is a specific layer on top of the output of language model and not supported by transformers library at the moment. The CRF layer is usually fine-tuned together with the language model itself, and improve the accuracy by a few points in F1 score, but in fact you can use any TNER models without CRF via transformers as blow.
Or simply with pipeline.
That way, you don’t even need to install tner, and all you need is transformers library. The drawback is that now the model don’t use CRF so the performance could slightly drop. I haven’t done any experiments to measure the performance of the models without CRF, so I can’t tell how much it would degrade. You may better test it locally with some test sentences in your use case first. |
Thank you so much @asahi417 for the response. I see why AllenNLP is used here. By the way, suppose someone needs the CRF layer too. In that case, what do you recommend for building the docker image? Do you have any guidance for the Dockerfile? thank you :) |
Hi @asahi417, in one of my projects, I am using different NLP models including NER, sentiment, and other text classifiers.
The models are all based on PyTorch. Currently, need to make one docker image supporting all models. Except for T-NER, for the rest, I could make a docker image, and it works smoothly. But to build docker for T-NER I have some issues since it is on top of
Allen-NLP and also needs some GCC as well.
It would be great if you can provide some guides for this task.
What approaches do you recommend using to build the image for the T_NER model?
What base image do you recommend? python base image, nvidia base image, torch base image or etc?
Do you recommend using conda env in Dockerfile?
Some details:
interested model: https://huggingface.co/tner/twitter-roberta-base-dec2021-tweetner7-all
Some requirements: python==3.9 torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchaudio==0.12.0
The text was updated successfully, but these errors were encountered: