文章要約のPegasusを動かそうとしたときに起きたエラー
![Thumbnail of post image 143](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/brooke-lark-HlNcigvUi4Q-unsplash.jpg?resize=150%2C150&ssl=1)
huggingfaceで提供されている文章要約モデルPegasusを下記ドキュメント通り動かそうとすると
TypeError: ‘NoneType’ object is not callable
ELMoEmbeddingsのときはallennlp==0.9.0
![Thumbnail of post image 119](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/bram-van-oost-6WvZo5FOxww-unsplash.jpg?resize=150%2C150&ssl=1)
NLPフレームワークのFlairでELMoの言語モデルを使おうとすると、from flair.embeddings import ELMoEmbeddingsをして関数を呼び出す必要があるのだが、allennlpがインストールされてい ...
Spacyで文から国名を取得
![Thumbnail of post image 102](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/erik-dungan-MQyCrJVFG8U-unsplash.jpg?resize=150%2C150&ssl=1)
事前準備
pip install spacy
python -m spacy download en_core_web_sm
コードimport spacynlp = spacy.load("en_core_web_s ...How to create vocab.txt ? [BERT][ELECTRA][Tokenizers]
![Thumbnail of post image 051](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/sidekix-media-FsgWEVacLU-unsplash.jpg?resize=150%2C150&ssl=1)
pip install tokenizersfrom tokenizers import BertWordPieceTokenizerfrom glob import globimport jsontxt_path = '/path/to/ ...
ELECTRAのpre-trainingを実行
![Thumbnail of post image 059](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/samantha-gades-BlIhVfXbi9s-unsplash.jpg?resize=150%2C150&ssl=1)
前準備
Tensorflow(GPU版)をpipでインストール。pipのバージョン違いで混乱することがあるため、私はpython -m pipでインストールした。バージョンは1.15にすること。
python -m pip ins ...BERTのpre-trainingを実行 [2020/9版]
![Thumbnail of post image 061](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/sidekix-media-FsgWEVacLU-unsplash.jpg?resize=150%2C150&ssl=1)
前準備
Tensorflow(GPU版)をpipでインストール。pipのバージョン違いで混乱することがあるため、私はpython -m pipでインストールした。バージョンは1.15にすること。
python -m pip ins ...ConvolutionとSelf-Attentionの違いは何ですか?[Quora]
![Thumbnail of post image 009](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/link-hoang-UoqAR2pOxMo-unsplash.jpg?resize=150%2C150&ssl=1)
機構に違いがあります。
Convolution(畳み込み)では入力データにフィルタと呼ばれる小領域をとり、これを1つの特徴量として畳み込みを行います。
イメージとしては、下の図のように、黄色のフィルタを緑色の画 ...
MeCabをPythonから使い形態素解析 [NLP]
![Thumbnail of post image 142](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/danielle-macinnes-IuLgi9PWETU-unsplash.jpg?resize=150%2C150&ssl=1)
sudo apt install mecab libmecab-dev mecab-ipadic-utf8 git make curl xz-utils file swigpip install mecab-python3pip insta ...
SciSpaCyでテキストからStopWord, 句読点, 数字を除去する
![Thumbnail of post image 006](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/piotr-wilk-Kc-OBw1fMJg-unsplash.jpg?resize=150%2C150&ssl=1)
自然言語で書かれたテキストの前処理として、“I, you, we, am, are” など、一般的に用いられるトークン (Stop word) や、数字や、句読点などを除去することがある。この前処理には、Gen ...