【发布时间】:2020-05-18 08:26:09
【问题描述】:
我正在使用此代码来获取数据集中句子的嵌入(我正在使用我的预训练模型)。
`python extract_features.py \
--input_file=/tmp/input.txt \
--output_file=/tmp/output.jsonl \
--vocab_file=$BERT_BASE_DIR/vocab.txt \
--bert_config_file=$BERT_BASE_DIR/bert_config.json \
--init_checkpoint=$BERT_BASE_DIR/bert_model.ckpt \
--layers=-1,-2,-3,-4 \
--max_seq_length=128 \
--batch_size=32`
但是,有一个问题:有没有一种方法可以更快地获得嵌入?因为 2000 个句子需要 6 个小时。我的数据集包含 20000 个句子; 60 小时对 Colab 来说太长了。 谢谢。
【问题讨论】:
标签: python google-colaboratory embedding bert-language-model