Git Product home page Git Product logo

tutorials's Introduction

About

These are tutorials on how to get started using the CLTK in your research. Whereas the CLTK official docs only explain individual functions, these notebooks are intended to be more illustrative of how you can use the functions together and answer real scholarly questions.

Pull requests are welcome.

License

MIT (see LICENSE).

tutorials's People

Contributors

apoorvpatne10 avatar aurelberra avatar clemsciences avatar diyclassics avatar djokester avatar free-variation avatar kylepjohnson avatar osho-agyeya avatar siddharthkv7 avatar theflash10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tutorials's Issues

problems with import

hello! I followed the tutorial, but when i run:

from cltk.corpus.utils.importer import CorpusImporter

i have the message:

ModuleNotFoundError: No module named 'cltk.corpus'

i'm using Ubuntu 20.04 and Python 3.8.5
Thank you in advance

ModuleNotFoundError: No module named 'cltk.corpus' (resolved from previous query)

In the jupyter notebook in my virtual environment, I try to run the line of code:
from cltk.corpus.utils.importer import CorpusImporter
and get the warning 'ModuleNotFoundError: No module named 'cltk.corpus'.

I try the same thing on Google colab and have the same issue.

cltk has been successfully installed in both cases. Do you have any advice for this issue?

I noticed someone else has the same unresolved issue here: https://stackoverflow.com/questions/67513247/cltk-module-in-python

Tried again to install NLTK on a Mac with python 3.6.0

(venv) iMac-de-Daniel-2:cltk Daniel$ pip install cltk
Downloading/unpacking cltk
   Cannot fetch index base URL https://pypi.python.org/simple/
   Could not find any downloads that satisfy the requirement cltk
 Cleaning up...
 No distributions at all found for cltk

what I'm doing wrong?

pyvenv

If you try to instal pyenv, as per your instructions

pyvenv venv

the terminal will reply:

WARNING: the pyenv script is deprecated in favour of python3.6 -m venv

so, what's one to do next) :)

Stuck again

I was self deluded when I thought I had installed the cltk! I did create the directory, and I was able to create the virtual environment, in two ways: first using the directions given here (using the (apparently deprecated):

$ pyvenv venv
$ source venv/bin/activate

this way lead me nowhere where I could install cltk

I tried the "reccommended" way to create a virtual environment executing the command venv:

python3 -m venv /path/to/new/virtual/environment

OK, that creates 3 directories in the cltk (bin, include, lib) but, again, no way to install nltk. Whenever I try either

python3 -m pip install cltk

or

pip install cltk

I get the following (error messages ahead; please forgive the verbosity)

Collecting cltk
Requirement already satisfied: pyuca in ./anaconda3/lib/python3.6/site-packages (from cltk) (1.2)
Requirement already satisfied: pyyaml in ./anaconda3/lib/python3.6/site-packages (from cltk) (3.12)
Requirement already satisfied: gitpython in ./anaconda3/lib/python3.6/site-packages (from cltk) (2.1.10)
Collecting regex (from cltk)
Collecting python-crfsuite (from cltk)
  Using cached https://files.pythonhosted.org/packages/e7/e8/02618c1e926df4aee70308676511b728b1db4ca9eb52d8c4660c14a44178/python-crfsuite-0.9.5.tar.gz
Requirement already satisfied: whoosh in ./anaconda3/lib/python3.6/site-packages (from cltk) (2.7.4)
Requirement already satisfied: nltk in ./anaconda3/lib/python3.6/site-packages (from cltk) (3.2.5)
Requirement already satisfied: gitdb2>=2.0.0 in ./anaconda3/lib/python3.6/site-packages (from gitpython->cltk) (2.0.3)
Requirement already satisfied: six in ./anaconda3/lib/python3.6/site-packages (from nltk->cltk) (1.11.0)
Requirement already satisfied: smmap2>=2.0.0 in ./anaconda3/lib/python3.6/site-packages (from gitdb2>=2.0.0->gitpython->cltk) (2.0.3)
Building wheels for collected packages: python-crfsuite
  Running setup.py bdist_wheel for python-crfsuite ... error
  Complete output from command /Users/Daniel/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/yk/sfnlb4yx7sn_wj0jp99_q4y80000gn/T/pip-install-204cb9vp/python-crfsuite/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/yk/sfnlb4yx7sn_wj0jp99_q4y80000gn/T/pip-wheel-s8h4n8tq --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.7-x86_64-3.6
  creating build/lib.macosx-10.7-x86_64-3.6/pycrfsuite
  copying pycrfsuite/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/pycrfsuite
  copying pycrfsuite/_dumpparser.py -> build/lib.macosx-10.7-x86_64-3.6/pycrfsuite
  copying pycrfsuite/_logparser.py -> build/lib.macosx-10.7-x86_64-3.6/pycrfsuite
  running build_ext
  building 'pycrfsuite._pycrfsuite' extension
  creating build/temp.macosx-10.7-x86_64-3.6
  creating build/temp.macosx-10.7-x86_64-3.6/pycrfsuite
  creating build/temp.macosx-10.7-x86_64-3.6/crfsuite
  creating build/temp.macosx-10.7-x86_64-3.6/crfsuite/lib
  creating build/temp.macosx-10.7-x86_64-3.6/crfsuite/lib/crf
  creating build/temp.macosx-10.7-x86_64-3.6/crfsuite/lib/crf/src
  creating build/temp.macosx-10.7-x86_64-3.6/crfsuite/swig
  creating build/temp.macosx-10.7-x86_64-3.6/crfsuite/lib/cqdb
  creating build/temp.macosx-10.7-x86_64-3.6/crfsuite/lib/cqdb/src
  creating build/temp.macosx-10.7-x86_64-3.6/liblbfgs
  creating build/temp.macosx-10.7-x86_64-3.6/liblbfgs/lib
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/Daniel/anaconda3/include -arch x86_64 -I/Users/Daniel/anaconda3/include -arch x86_64 -Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include -Ipycrfsuite -I/Users/Daniel/anaconda3/include/python3.6m -c pycrfsuite/_pycrfsuite.cpp -o build/temp.macosx-10.7-x86_64-3.6/pycrfsuite/_pycrfsuite.o -std=c99
  error: invalid argument '-std=c99' not allowed with 'C++/ObjC++'
  error: command 'gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for python-crfsuite
  Running setup.py clean for python-crfsuite
Failed to build python-crfsuite
Installing collected packages: regex, python-crfsuite, cltk
  Running setup.py install for python-crfsuite ... error
    Complete output from command /Users/Daniel/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/yk/sfnlb4yx7sn_wj0jp99_q4y80000gn/T/pip-install-204cb9vp/python-crfsuite/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/yk/sfnlb4yx7sn_wj0jp99_q4y80000gn/T/pip-record-x145uk_s/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.6
    creating build/lib.macosx-10.7-x86_64-3.6/pycrfsuite
    copying pycrfsuite/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/pycrfsuite
    copying pycrfsuite/_dumpparser.py -> build/lib.macosx-10.7-x86_64-3.6/pycrfsuite
    copying pycrfsuite/_logparser.py -> build/lib.macosx-10.7-x86_64-3.6/pycrfsuite
    running build_ext
    building 'pycrfsuite._pycrfsuite' extension
    creating build/temp.macosx-10.7-x86_64-3.6
    creating build/temp.macosx-10.7-x86_64-3.6/pycrfsuite
    creating build/temp.macosx-10.7-x86_64-3.6/crfsuite
    creating build/temp.macosx-10.7-x86_64-3.6/crfsuite/lib
    creating build/temp.macosx-10.7-x86_64-3.6/crfsuite/lib/crf
    creating build/temp.macosx-10.7-x86_64-3.6/crfsuite/lib/crf/src
    creating build/temp.macosx-10.7-x86_64-3.6/crfsuite/swig
    creating build/temp.macosx-10.7-x86_64-3.6/crfsuite/lib/cqdb
    creating build/temp.macosx-10.7-x86_64-3.6/crfsuite/lib/cqdb/src
    creating build/temp.macosx-10.7-x86_64-3.6/liblbfgs
    creating build/temp.macosx-10.7-x86_64-3.6/liblbfgs/lib
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/Daniel/anaconda3/include -arch x86_64 -I/Users/Daniel/anaconda3/include -arch x86_64 -Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include -Ipycrfsuite -I/Users/Daniel/anaconda3/include/python3.6m -c pycrfsuite/_pycrfsuite.cpp -o build/temp.macosx-10.7-x86_64-3.6/pycrfsuite/_pycrfsuite.o -std=c99
    error: invalid argument '-std=c99' not allowed with 'C++/ObjC++'
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/Users/Daniel/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/yk/sfnlb4yx7sn_wj0jp99_q4y80000gn/T/pip-install-204cb9vp/python-crfsuite/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/yk/sfnlb4yx7sn_wj0jp99_q4y80000gn/T/pip-record-x145uk_s/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/yk/sfnlb4yx7sn_wj0jp99_q4y80000gn/T/pip-install-204cb9vp/python-crfsuite/

from cltk.corpus.greek.tei import onekgreek_tei_xml_to_text in version 1.0

Hi,
Reading through Tutorial 2 "Import Corpora" I came across the from cltk.corpus.greek.tei import onekgreek_tei_xml_to_text function. I can't seem to find it in the version 1 documentation or get it to work. Is there a built-in method for quickly converting .xml files from Perseus or First Thousand Years to .txt, or should I use Beautiful Soup etc.?
Fergus.

Nothing here ?

Hey contributors, why is there nothing here ? When I find time, I'll write a tutorial to use tools for Old Norse (the ones I programmed). It will help beginners .

How is this actually even used?

The tutorials do not really tell me how to use this.

For example, what happens between #2 and #3?

So I can import corpora in step 2, and the dowload works because I can see them in ~/cltk_data/. Great. But now how do I use them? I don't really see a way to do this. Do I now have to read the files using file.read() or somesuch? Is the general goal to not use the corpora for analysis but to use them as trained data sets to analyze some other texts that we find?

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.