GithubHelp home page GithubHelp logo

Comments (12)

RakshaRaoKaraya avatar RakshaRaoKaraya commented on May 25, 2024

Can someone please help me with this issue?

from spark-nlp.

RakshaRaoKaraya avatar RakshaRaoKaraya commented on May 25, 2024

@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.
image

from spark-nlp.

maziyarpanahi avatar maziyarpanahi commented on May 25, 2024

@RakshaRaoKaraya

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.

RakshaRaoKaraya avatar RakshaRaoKaraya commented on May 25, 2024

@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.

maziyarpanahi avatar maziyarpanahi commented on May 25, 2024

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:

from spark-nlp.

RakshaRaoKaraya avatar RakshaRaoKaraya commented on May 25, 2024

@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.

RakshaRaoKaraya avatar RakshaRaoKaraya commented on May 25, 2024

Hello @maziyarpanahi : Could you please tell me when can I expect a resolution of this bug?

from spark-nlp.

maziyarpanahi avatar maziyarpanahi commented on May 25, 2024

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.

RakshaRaoKaraya avatar RakshaRaoKaraya commented on May 25, 2024

@maziyarpanahi : Thank you so much for your response. I will wait for the resolution then.

from spark-nlp.

RakshaRaoKaraya avatar RakshaRaoKaraya commented on May 25, 2024

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.

maziyarpanahi avatar maziyarpanahi commented on May 25, 2024

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.

RakshaRaoKaraya avatar RakshaRaoKaraya commented on May 25, 2024

Works perfectly well now. Thank you once again 👍

from spark-nlp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.