問題タブ [torchtext]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
nlp - Example.fromJSON(data.read(), fields)
に相当するものはExample.fromJSON(data.read(), fields)
何ですか?いくつかのトランスフォーマーによって、機械学習モデルの一部の lstm を変更する必要があります。次に、トランスフォーマーを使用してデータを前処理します。
編集
ソース: https://huggingface.co/docs/datasets/loading_datasets.html
上記のコードを使用する必要があると思いますが、まだわかりません。
python - AttributeError: モジュール 'torchtext.datasets' には属性 'text_classification' がありません
上記の行を実行した後、属性エラーが発生します。
AttributeError トレースバック (最新の呼び出しが最後) ----> 1 agnews_train, agnews_test = torchtext.datasets.text_classification.DATASETS"AG_NEWS"
AttributeError: モジュール 'torchtext.datasets' には属性 'text_classification' がありません
python - Why is the result different for same dataset in torchtext.legecy.text when i change the position of data in the csv file?
I am trying to learn PyTorch NLP basic text classification and following Lazy Programmer's Tutorial and I got a different result from the tutorial and when I tried to change the data, I encountered a strange change in the output.
#xA;This is my first type of code and in the data, if you see i have used "'ham and eggs or just morning'," in index 1. So after running the code, at last when i run vocab.stoi, I get the following output. The output for the code.
#xA;Now In the second code, I have change the index of data "'ham and eggs or just morning'," in third index, now if I run the code then I get different output for vocab.stoi output for the second code. I want to know the reason for this and how vocab_build works in PyTorch. Plus, this is my first question, if the question is not clear please let me know.
nlp - 2 つの異なるバケット イテレータ オブジェクトからのバッチ間の切り替え
BucketIterator オブジェクトの下に、Iterator1 と Iterator2 の 2 つがあります。
トレーニングには、2 つのイテレーターを使用する必要があります (私の場合、混合はできません) トレーニング中に、これら 2 つのイテレーターからのバッチを使用しています。たとえば、イテレーター1 からのバッチ 1 と、イテレーター2 からのバッチ 2 …</p>
トレーニング中にこれらのバッチ (バッチ 1 とバッチ 2) を交互に使用したいのですが、それができません。バケット イテレーターについて今まで学んだことは… next() がなく、for(itr を反復処理することしかできないためです。 in iterator1) …</p>
そのため、現在私はパイプライン ベースで使用しています…最初に iterator1 でトレーニングを完了し、次に iterator2 …</p>
これらを同じ意味で使用する方法を教えてください。ありがとう…</p>