🚀 科学エンティティ認識用SciBERTベースモデル
このモデルは、科学分野のエンティティ認識タスクに特化したSciBERTベースのモデルです。予め定義されたエンティティタイプには、'Generic'、'Material'、'Method'、'Metric'、'OtherScientificTerm'、'Task' が含まれます。
🚀 クイックスタート
このモデルを使用するには、以下のコードを参考にしてください。
基本的な使用法
from transformers import AutoConfig, AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained('Kashob/SciBERTNER')
model = AutoModelForTokenClassification.from_pretrained('Kashob/SciBERTNER')
config = AutoConfig.from_pretrained('Kashob/SciBERTNER')
id2tag = config.id2label
text = 'The paper tackles the problem of endowing Transformers with the ability to encode information about the past via recurrence. The proposed architecture can leverage the recurrent connections to improve the sample efficiency while maintaining expressivity due to the use of self-attention.'.split()
inputs = tokenizer(text, is_split_into_words=True, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
predictions = outputs.logits.argmax(-1)
tokenized_text = tokenizer.convert_ids_to_tokens(inputs['input_ids'].tolist()[0])
predicted_labels = [id2tag[label_id] for label_id in predictions[0].tolist()]
print(tokenized_text)
print(predicted_labels)
Output:
['[CLS]', 'the', 'paper', 'tackle', '##s', 'the', 'problem', 'of', 'endow', '##ing', 'transformers', 'with', 'the', 'ability', 'to', 'encode', 'information', 'about', 'the', 'past', 'via', 'recurrence', '.', 'the', 'proposed', 'architecture', 'can', 'leverage', 'the', 'recurrent', 'connections', 'to', 'improve', 'the', 'sample', 'efficiency', 'while', 'maintaining', 'express', '##ivity', 'due', 'to', 'the', 'use', 'of', 'self', '-', 'attention', '.', '[SEP]']
['O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'B-OtherScientificTerm', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'B-Method', 'O', 'O', 'O', 'B-Generic', 'O', 'O', 'O', 'B-OtherScientificTerm', 'I-OtherScientificTerm', 'O', 'O', 'O', 'B-Metric', 'I-Metric', 'O', 'O', 'B-Metric', 'I-OtherScientificTerm', 'O', 'O', 'O', 'O', 'O', 'B-Method', 'I-OtherScientificTerm', 'I-OtherScientificTerm', 'O', 'O']
✨ 主な機能
- このモデルは、科学文献内のエンティティを認識するために設計されています。
- 予め定義された6種類のエンティティタイプを識別できます。
📚 ドキュメント
モデルの詳細
モデルの説明
これは、科学的エンティティ認識タスク用のSciBERTベースのモデルです。予め定義されたエンティティタイプは、'Generic'、'Material'、'Method'、'Metric'、'OtherScientificTerm'、'Task' です。
モデルのソース
📄 ライセンス
このモデルはMITライセンスの下で提供されています。
モデルカードの作成者
Kashob Kumar Roy
CS, UIUC
モデルカードの問い合わせ先
- メール: kkroy2 at illinois dot edu
この事前学習モデルに関する質問があれば、お気軽に問い合わせてください。