Code Monkey home page Code Monkey logo

Comments (3)

Fati-Hei avatar Fati-Hei commented on June 12, 2024

By the example I meant --> quick_start.ipynb.

from skweak.

plison avatar plison commented on June 12, 2024

You mean you ran the quick_start.ipynb example, but on Norwegian texts? Well the examples of labelling functions given in the jupyter notebook (for instance the company_detector and the other_org_detector) are made for the kind of English-language news articles used in this example, so they will most likely not detect anything on Norwegian texts (which means that there won't be anything to aggregate). You need to tailor your labelling functions to the texts you have in your collection.

from skweak.

Fati-Hei avatar Fati-Hei commented on June 12, 2024

Yes on Norwegian text with Norwegian labels.
This is how I used the example:

`nlp = spacy.load("nb_core_news_lg",disable=["ner", "lemmatizer"])
docs = list(nlp.pipe(df.content.values))

OTHER_ST_WORDS = {"NS","NEK","TEK"}
def standards_detector(doc):
for chunk in doc.noun_chunks:
#print(chunk[-1])
if any([token.text in OTHER_ST_WORDS for token in chunk]):
yield chunk.start, chunk.end, "STA"

other_st_detector = skweak.heuristics.FunctionAnnotator("st_detector", standards_detector)

docs = list(other_st_detector.pipe(docs))

skweak.utils.display_entities(docs[8], "st_detector")`

from skweak.

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.