Code Monkey home page Code Monkey logo

Comments (3)

brucewlee avatar brucewlee commented on September 18, 2024

Furthermore, in an application like this:

`import spacy
from ewiser.spacy.disambiguate import Disambiguator
from spacy.language import Language
import utils

nlp = spacy.load("en_core_web_sm", disable=['parser', 'ner'])

@Language.factory('wsd')
def wsd_engine(nlp, name):
    return Disambiguator('ewiser/ewiser.semcor+wngt.pt', lang="en")

nlp.add_pipe('wsd', last=True)

# example
doc = nlp("Have you ever wondered how you are able to remember things for a long time?")

for w in doc:
    print(w.text)
    if w._.offset:
        sensekey = utils.offsets2sensekeys(w._.offset, w.lemma_)
        print(sensekey)`

Why isn't the model predicting WN offset for all words? From "Have you ever wondered how you are able to remember things for a long time?", the model only gives output for

ever%4:02:04::
wonder%2:32:01::
able%3:00:00::
remember%2:31:00::
thing%1:10:00::
long%3:00:02::
time%1:28:05::

from ewiser.

mbevila avatar mbevila commented on September 18, 2024

Hi,

  1. The offsets are the unique IDs that are assigned to synsets (groups of senses). EWISER performs classification at the synset level, and that's why we output WN offsets. Offsets, as you seem to have managed to do judging from your code snippet, can be mapped to sensekeys quite easily given the lemma. I am not planning to add sensekeys to the Spacy plugin for the foreseeable future, but we welcome PRs :)

  2. WN only covers nouns, verbs, adjectives, and adverbs--with some exceptions, e.g. interrogative adverbs. Can't predict senses for anything else. In your example sentence, the only things that belong to one of the former part of speech but are (correctly) not disambiguated are "have" and "are", as they function as, respectively, auxilliary verb and copula.

from ewiser.

brucewlee avatar brucewlee commented on September 18, 2024

Thanks for the comment. I'll make the pull request with appropriate modifications.

from ewiser.

Related Issues (16)

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.