realpython / realpython/materials

textcat -> architecture extra fields not permitted

オープン
#191 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Jupyter Notebook
スター
5.2k
フォーク
5.3k
平均マージ
4日 10時間
マージ済み PR(30日)
10

説明

Good evening sir,

I've been trying to practise what I've learned from your tutorial:(https://realpython.com/sentiment-analysis-python/) using PyCharm.

And these lines:
textcat.add_label("pos")
textcat.add_label("neg")

generated a warning ==>
#Cannot find reference 'add_label' in '(Doc) -> Doc | (Doc) -> Doc'

I thought it maybe because of a difference between my spacy version and yours, so I run the script anyway, but then I got the an error from this line==>

textcat = nlp.create_pipe("textcat", config={"architecture": "simple_cnn"})

Error msg:
raise ConfigValidationError(
thinc.config.ConfigValidationError:

Config validation error

textcat -> architecture extra fields not permitted

{'nlp': <spacy.lang.en.English object at 0x0000015E74F625E0>, 'name': 'textcat', 'architecture': 'simple_cnn', 'model': {'@architectures': 'spacy.TextCatEnsemble.v2', 'linear_model': {'@architectures': 'spacy.TextCatBOW.v1', 'exclusive_classes': True, 'ngram_size': 1, 'no_output_layer': False}, 'tok2vec': {'@architectures': 'spacy.Tok2Vec.v2', 'embed': {'@architectures': 'spacy.MultiHashEmbed.v1', 'width': 64, 'rows': [2000, 2000, 1000, 1000, 1000, 1000], 'attrs': ['ORTH', 'LOWER', 'PREFIX', 'SUFFIX', 'SHAPE', 'ID'], 'include_static_vectors': False}, 'encode': {'@architectures': 'spacy.MaxoutWindowEncoder.v2', 'width': 64, 'window_size': 1, 'maxout_pieces': 3, 'depth': 2}}}, 'threshold': 0.5, '@factories': 'textcat'}

I'm very new to spacy and data analysis over all, so please excuse me if it's a stupid mistake from my side.

Thank you

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Issue にリンクされている感情分析チュートリアルと、nlp.create_pipe("textcat", config={"architecture": "simple_cnn"}) および textcat.add_label を使用している行から始めます。チュートリアルが想定している spaCy のバージョンと、ConfigValidationError を発生させているバージョンを確認します。追加フィールドのエラーなしで例が実行され、ラベル呼び出しがサポートされているバージョンに対して有効であれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
machine-learning
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。