Python 20 1月 2021 Flairでエラーがでたらバージョンを上げる エラー ModuleNotFoundError: No module named 'flair.embeddings.token'; 'flair.embeddings' is not a packa[…] 続きを読む
Python 19 1月 2021 サポート外の引数が入ってきたときの例外処理 [Python] スクリプトに一行挿入する.この場合,変数hogeに括弧内以外の文字列が入っているときにエラーをだす. assert hoge in ("hogeA", "hogeB", "hogeC")[…] 続きを読む
Python 19 1月 2021 yamlとdocoptを利用した引数指定 [Python] 個人的に,入出力をdocoptを記述し,コンフィグ情報はyamlを使って引数として取り込むのが好きなので,そのスクリプトについてメモしておく.decoptの記述では,空行を設けることが重要なので,必要[…] 続きを読む
Flair 15 12月 2020 Flairのtraining.logからmicro recallとprecisionを算出するコード FlairでNERを実施した際,training.logというのが出力されるのだが,これにはmicro F1は載っているが,micro recallとprecisionは載っていない.このため,ログフ[…] 続きを読む
Python 15 12月 2020 文字列に含まれる複数のスペースを1つに置換 生データを処理しているとよく遭遇する複数のスペースを含む文章. 2つ以上のスペースを1つにしたいときは以下のコマンド ' '.join(mystring.split())[…] 続きを読む
Flair 19 11月 2020 FlairでサクッとNERを実行するコード [Python] from flair.data import Corpus from flair.datasets import ColumnCorpus from flair.models import Seque[…] 続きを読む
Python 19 11月 2020 mod_wsgiをインストールする時のエラーの対処法 エラーに遭遇 pip install mod_wsgiを実行すると,以下のようなエラーがでた ERROR: Command errored out with exit status 1: comman[…] 続きを読む
Python 19 11月 2020 pyenvでインストールした環境を削除 [Python] # 現状確認 pyenv versions >> * 3.8.6 >> system (set by /home/ubuntu/.pyenv/version) # pythonの環境を元のsyste[…] 続きを読む
Flair 19 11月 2020 Flair trainer.trainのパラメータ一覧 [Python] """Trains any class that implements the flair.nn.Model interface.:param base_path: Main path to whic[…] 続きを読む
Python 18 11月 2020 ImportError: numpy.core.multiarray failed to import [Python] Traceback (most recent call last):File "/home/ubuntu/script/train.py", line 1, infrom flair.data imp[…] 続きを読む