import huggingface_konlpy
import tokenizers
tokenizers.__version__
- NLP 관련 다양한 패키지를 제공하고 있으며, 특히 언어 모델 (language models) 을 학습하기 위하여 세 가지 패키지가 유용
package | note |
---|---|
transformers | Transformer 기반 (masked) language models 알고리즘, 기학습된 모델을 제공 |
tokenizers | transformers 에서 사용할 수 있는 토크나이저들을 학습/사용할 수 있는 기능 제공. transformers 와 분리된 패키지로 제공 |
nlp | 데이터셋 및 평가 척도 (evaluation metrics) 을 제공 |
from sklearn.datasets import make_classification
X, y = make_classification(
n_samples=50000, n_features=200, n_informative=5,
n_redundant=0, n_clusters_per_class=10, weights=[0.80],
flip_y=0.05, class_sep=3.5, random_state=42
)
# standard normalization: (x - mean) / std
현재 버전 (0.0.491) 에서는 코드가 정리되지 않아서 init 함수의 argument 이름이 바뀔 수 있습니다.
이 튜토리얼은 github.com/lovit/textmining-dataset 의 데이터셋을 이용한 예시입니다.
import soynlp
from soynlp.utils import DoublespaceLineCorpus
from soynlp.noun import LRNounExtractor_v2
from lovit_textmining_dataset.navernews_10days import get_news_paths
This file contains 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
# replace matplotlib.pyplot.imshow(img) | |
import numpy as np | |
from bokeh.plotting import figure, show, output_notebook | |
output_notebook() | |
N = 500 | |
x = np.linspace(0, 10, N) |
As configured in my dotfiles.
start new:
tmux
start new with session name: