Created
April 27, 2023 15:46
-
-
Save dataf3l/245edaa0e6f68580b5eb6d4d3d0d4d13 to your computer and use it in GitHub Desktop.
nlp-ideas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ nlp vi nlp1.py | |
➜ nlp pyhton3 -m venv venv | |
zsh: command not found: pyhton3 | |
➜ nlp python3 -m venv venv | |
source venv/bi% | |
➜ nlp source venv/bin/activate | |
(venv) ➜ nlp ls | |
nlp1.py venv | |
(venv) ➜ nlp pip install nltk | |
pCollecting nltk | |
Using cached nltk-3.8.1-py3-none-any.whl (1.5 MB) | |
Collecting click | |
Using cached click-8.1.3-py3-none-any.whl (96 kB) | |
Collecting joblib | |
Using cached joblib-1.2.0-py3-none-any.whl (297 kB) | |
Collecting tqdm | |
Using cached tqdm-4.65.0-py3-none-any.whl (77 kB) | |
Collecting regex>=2021.8.3 | |
Using cached regex-2023.3.23-cp310-cp310-macosx_11_0_arm64.whl (288 kB) | |
Installing collected packages: tqdm, regex, joblib, click, nltk | |
ython Successfully installed click-8.1.3 joblib-1.2.0 nltk-3.8.1 regex-2023.3.23 tqdm-4.65.0 | |
[notice] A new release of pip is available: 23.0 -> 23.1.2 | |
[notice] To update, run: pip install --upgrade pip | |
(venv) ➜ nlp python nlp1.py | |
Original word: corriendo | |
Stemmed word: corr | |
(venv) ➜ nlp ls | |
nlp1.py venv | |
(venv) ➜ nlp cat nlp1.py | |
from nltk.stem import SnowballStemmer | |
stemmer = SnowballStemmer('spanish') | |
word = 'corriendo' | |
stemmed_word = stemmer.stem(word) | |
print(f'Original word: {word}') | |
print(f'Stemmed word: {stemmed_word}') | |
(venv) ➜ nlp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment