Code Monkey home page Code Monkey logo

Comments (7)

upasana-mittal avatar upasana-mittal commented on June 24, 2024 5

I had issue because I will installing on commit hash but since I switched to full git, it is working fine. no more error

pip install git+https://github.com/boudinfl/pke.git

from pke.

ajithb073 avatar ajithb073 commented on June 24, 2024 3

Reason for KeyError: Pke library requires nltk library for the language codes. In pke's "langcodes.py" there is absence of language code for 'hinglish'.

Solution: In the home location, the "nltk_data" folder will be present. Inside nltk_data/corpora/stopwords there will be
file named as 'hinglish'. Just remove that file from that folder and your error will be taken care of.

from pke.

hammadmukhtar21 avatar hammadmukhtar21 commented on June 24, 2024 1

where to get "nltk_data" folder in colab?

Check the path where nltk is downloading. Normally it is stored in the /root/ directory. You can access the root directory on the left side of the colab pane by clicking on "..." which means more options. It is visible beside the sample.

nltk
nltk2

from pke.

talhaanwarch avatar talhaanwarch commented on June 24, 2024 1

you can simply do
!rm /root/nltk_data/corpora/stopwords/hinglish

btw removing did not worked for me

btw i did not face the issue with latest version

from pke.

atabas avatar atabas commented on June 24, 2024

I'm getting the same error...does anyone know what's wrong?

from pke.

aradhana298 avatar aradhana298 commented on June 24, 2024

where to get "nltk_data" folder in colab?

from pke.

ygorg avatar ygorg commented on June 24, 2024

As said earlier in the thread, please update to the latest version.
If you are using pke with an unsupported language please provide custom stopwords using stoplist argument as such:

shadok_stoplist = ['ga', 'zo']
preprocessed_document = [  # Obtained via custom pos tagging tool or manual annotation
    [('ga', 'DET'), ('bu', 'NOUN'), ('zo', 'AUX'), ('meu', 'ADJ'), ('.', 'PUNCT')]
]
e = pke.unsupervised.MultipartiteRank()
e.load_document(
    preprocessed_document, language='shadok',
    stoplist=shadok_stoplist, normalization=None)

from pke.

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.