Comments (12)
Can someone please help me with this issue?
from spark-nlp.
@maziyarpanahi, @josejuanmartinez : I have tried the example in https://sparknlp.org/2023/02/08/zero_shot_ner_roberta_en.html . It still gives me the same issue. It picks the next entity and gives it the label. The labels are right, but the entities are wrong.
from spark-nlp.
There seems to be an issue with NerConverter
and ZeroShotNER. As you can see, the ZeroShot detected the entities and their labels correctly: https://colab.research.google.com/drive/1xX_9Rrnvxb7O-C9ICvTs9rSmA-rLSB_E?usp=sharing
result.select("zero_shot_ner.result").show(1, False)
+-------------------------------------------------------------------------------------+
|result |
+-------------------------------------------------------------------------------------+
|[O, O, O, O, O, O, O, O, O, O, O, O, O, B-NAME, O, O, O, O, O, O, O, O, O, O, B-CITY]|
+-------------------------------------------------------------------------------------+
result.select("zero_shot_ner").show(1, False)
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|zero_shot_ner |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|[{named_entity, 0, 5, O, {sentence -> 0, word -> Hellen}, []}, {named_entity, 7, 11, O, {sentence -> 0, word -> works}, []}, {named_entity, 13, 14, O, {sentence -> 0, word -> in}, []}, {named_entity, 16, 21, O, {sentence -> 0, word -> London}, []}, {named_entity, 22, 22, O, {sentence -> 0, word -> ,}, []}, {named_entity, 24, 28, O, {sentence -> 0, word -> Paris}, []}, {named_entity, 30, 32, O, {sentence -> 0, word -> and}, []}, {named_entity, 34, 39, O, {sentence -> 0, word -> Berlin}, []}, {named_entity, 40, 40, O, {sentence -> 0, word -> .}, []}, {named_entity, 42, 43, O, {sentence -> 0, word -> My}, []}, {named_entity, 45, 48, O, {sentence -> 0, word -> name}, []}, {named_entity, 50, 51, O, {sentence -> 0, word -> is}, []}, {named_entity, 53, 57, O, {sentence -> 0, word -> Clara}, []}, {named_entity, 58, 58, B-NAME, {sentence -> 0, word -> ,, confidence -> 0.94376206, question -> What is my name?}, []}, {named_entity, 60, 60, O, {sentence -> 0, word -> I}, []}, {named_entity, 62, 65, O, {sentence -> 0, word -> live}, []}, {named_entity, 67, 68, O, {sentence -> 0, word -> in}, []}, {named_entity, 70, 72, O, {sentence -> 0, word -> New}, []}, {named_entity, 74, 77, O, {sentence -> 0, word -> York}, []}, {named_entity, 79, 81, O, {sentence -> 0, word -> and}, []}, {named_entity, 83, 88, O, {sentence -> 0, word -> Hellen}, []}, {named_entity, 90, 94, O, {sentence -> 0, word -> lives}, []}, {named_entity, 96, 97, O, {sentence -> 0, word -> in}, []}, {named_entity, 99, 103, O, {sentence -> 0, word -> Paris}, []}, {named_entity, 104, 104, B-CITY, {sentence -> 0, word -> ., confidence -> 0.3440236, question -> Which is the city?}, []}]|
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
only showing top 1 row
But it failed to put them together via NerConverter. Seems to be a bug, we'll take a look and fix it for the next release.
from spark-nlp.
@maziyarpanahi : Thank you very much for your reply. Would you be able to give me a tentative date when this could be resolved? Or is there any other NER models that I could use meanwhile to detected entities based on Question Answer Model?
from spark-nlp.
You are very welcome. We have many NER models both based on our own architecture or all-in-one from Hugging Face. (trained by us)
They are not however zero-shot, meaning the labels are pre-defined. You can have a look for the meantime while we fix this small part:
- This is for NER based on BERT: https://sparknlp.org/models?task=Named+Entity+Recognition&annotator=BertForTokenClassification
- I personally suggest this one from OntoNotes 5.0 and DeBerta that has the highest accuracy and 18 entities: https://sparknlp.org/2022/05/06/deberta_v3_base_token_classifier_ontonotes_en_3_0.html
from spark-nlp.
@maziyarpanahi : Thank you for the suggestions. I was hoping to get a question answer type of NER. Even though I am capturing pre-defined entities, I need to capture answers to specific questions in the text. I think Zero-shot would help better. I didn't come across any other model that does that.
from spark-nlp.
Hello @maziyarpanahi : Could you please tell me when can I expect a resolution of this bug?
from spark-nlp.
Hello @maziyarpanahi : Could you please tell me when can I expect a resolution of this bug?
Hi, we are still investigating this issue. I'll update here once we have a fix for it
from spark-nlp.
@maziyarpanahi : Thank you so much for your response. I will wait for the resolution then.
from spark-nlp.
Hello @maziyarpanahi : Thank you for looking into this issue. Is the model good to use now in python environment? Do I need to change my Spark NLP version for this to work?
from spark-nlp.
Hello @maziyarpanahi : Thank you for looking into this issue. Is the model good to use now in python environment? Do I need to change my Spark NLP version for this to work?
You are welcome. You must have Spark NLP 5.3.0 and everything would work without any change.
from spark-nlp.
Works perfectly well now. Thank you once again 👍
from spark-nlp.
Related Issues (20)
- Spark NLP Configuration's spark.jsl.settings.storage.cluster_tmp_dir: Databricks DBFS location does not work HOT 3
- spark-nlp in databricks writing to root s3 in cluster HOT 1
- Import Whisper large v3 into Spark NLP HOT 5
- Cannot cast to float HOT 8
- Flexible normalization HOT 1
- XlmRoBertaSentenceEmbeddings returns huge amount of embeddings instead of set dimensions
- Sparknlp returning different embedding for manual spark dataframe vs reading from file spark dataframe HOT 5
- SparkNLP Embeddings inference 3X slower than with pandas_udf HOT 3
- EntityRuler fails two basic tests HOT 3
- Show an error of 'GLIBC_2.27 not found' when pretrained model download in AWS EMR HOT 2
- Onnx models fail when saving transformer
- Hardcoded column name in DocumentSimilarityRanker annotator
- ERROR TorrentBroadcast: Store broadcast broadcast_5 fail, remove all pieces of the broadcast HOT 7
- Scala 2.13 support HOT 1
- org.apache.spark.SparkException: [FAILED_EXECUTE_UDF] HOT 3
- DependencyParserApproach throws "IllegalArgumentException: For input string: "_"" when training with CONLLU dataset HOT 5
- When Attempting to loadSavedModel, I Encountered 'java.lang.Exception: Could Not Retrieve the SavedModelBundle + () HOT 16
- Importing models into Spark NLP in TensorFlow and ONNX formats
- MultiClassifierDLApproach not transforming every row of my dataset HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spark-nlp.