問題タブ [huggingface-datasets]
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.
python - HuggingFace データセットに新しい列を追加する
データセットには 5000000 行あり、データセットに「embeddings」という列を追加したいと思います。
dataset = dataset.add_column('embeddings', embeddings)
変数embeddingsは、サイズ(5000000、512)のnumpy memmap配列です。
しかし、私はこのエラーが発生します:
ArrowInvalidTraceback (最近の呼び出しが最後) ----> 1 データセット = dataset.add_column('embeddings', 埋め込み)
/opt/conda/lib/python3.8/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 486 } 487 # 実際の関数を適用 --> 488 out: Union["Dataset", " DatasetDict"] = func(self, *args, **kwargs) 489 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 490 # フォーマットを再適用出力へ
/opt/conda/lib/python3.8/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 404 # 実際の関数を呼び出す 405 --> 406 out = func(self, *args, * *kwargs) 407 408 # インプレース変換のフィンガープリントを更新 + 変換のインプレース履歴を更新
/opt/conda/lib/python3.8/site-packages/datasets/arrow_dataset.py in add_column(self, name, column, new_fingerprint) 3346 :class:
Dataset
3347 """ -> 3348 column_table = InMemoryTable.from_pydict({name : column}) 3349 # テーブルを水平に連結 3350 table = ConcatenationTable.from_tables([self._data, column_table], axis=1)/opt/conda/lib/python3.8/site-packages/datasets/table.py in from_pydict(cls, *args, **kwargs) 367 @classmethod 368 def from_pydict(cls, *args, **kwargs): - -> 369 リターン cls(pa.Table.from_pydict(*args, **kwargs)) 370 371 @inject_arrow_table_documentation(pa.Table.from_batches)
/opt/conda/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_pydict()
/opt/conda/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib._from_pydict()
/opt/conda/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.asarray()
/opt/conda/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array()
/opt/conda/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._ndarray_to_array()
/opt/conda/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status()
ArrowInvalid: 1 次元配列のみを処理します
埋め込み配列がRAMに収まらないため、おそらく効率的な方法で解決するにはどうすればよいですか?
python - どの ROUGE 値を報告しますか?
私の MT システムでは、https: //huggingface.co/metrics/rouge を使用して ROUGE-L 値を計算しました。出力は以下のようになります。ほとんどの論文が 1 つの ROUGE-L 値を報告しており、私も同じことをしたいと考えています。ただし、出力は次のようになり、どの値を報告すればよいかわかりません。低または中または高を報告する必要がありますか? 歳差運動か、リコールか、F 値か。
'rougeL': AggregateScore(low=Score(precision=0.34535176087958586, recall=0.36969750745470553, fmeasure=0.33939664257593155), mid=Score(precision=0.40405631462907, recall=0.41156890941875457, fmeasure=0.3835437703820411), high=Score(precision=0.4648738881460244, recall= 0.4597817743860313、fmeasure = 0.43226391587929297)))