🚀 名詞化檢測器
本模型用於識別“謂詞性名詞化”,即在上下文中具有事件性(或“動詞性”)含義的名詞化形式。它基於bert-base-cased
預訓練模型,針對QANom項目(Klein等人,COLING 2020)所定義和標註的“名詞化檢測”任務進行了標記分類的微調。
🚀 快速開始
本模型作為二元分類器進行訓練,用於對候選名詞化形式進行分類。候選詞通過詞性標註器(篩選普通名詞)以及詞彙資源(如WordNet和CatVar)提取,篩選出具有(至少一個)派生相關動詞的名詞。在QANom標註項目中,這些候選詞會交給標註人員,以確定它們在句子上下文中是否具有“動詞性”含義。當前模型可重現這種二元分類。
✨ 主要特性
- 基於
bert-base-cased
預訓練模型,針對名詞化檢測任務進行微調。
- 能夠識別句子中具有事件性含義的名詞化形式。
📦 安裝指南
候選詞提取算法在qanom
包中實現。你可以通過以下命令安裝qanom
包:
pip install qanom
💻 使用示例
基礎用法
from qanom.nominalization_detector import NominalizationDetector
detector = NominalizationDetector()
raw_sentences = ["The construction of the officer 's building finished right after the beginning of the destruction of the previous construction ."]
print(detector(raw_sentences, return_all_candidates=True))
print(detector(raw_sentences, threshold=0.75, return_probability=False))
輸出示例
[[{'predicate_idx': 1,
'predicate': 'construction',
'predicate_detector_prediction': True,
'predicate_detector_probability': 0.7626778483390808,
'verb_form': 'construct'},
{'predicate_idx': 4,
'predicate': 'officer',
'predicate_detector_prediction': False,
'predicate_detector_probability': 0.19832570850849152,
'verb_form': 'officer'},
{'predicate_idx': 6,
'predicate': 'building',
'predicate_detector_prediction': True,
'predicate_detector_probability': 0.5794129371643066,
'verb_form': 'build'},
{'predicate_idx': 11,
'predicate': 'beginning',
'predicate_detector_prediction': True,
'predicate_detector_probability': 0.8937646150588989,
'verb_form': 'begin'},
{'predicate_idx': 14,
'predicate': 'destruction',
'predicate_detector_prediction': True,
'predicate_detector_probability': 0.8501205444335938,
'verb_form': 'destruct'},
{'predicate_idx': 18,
'predicate': 'construction',
'predicate_detector_prediction': True,
'predicate_detector_probability': 0.7022264003753662,
'verb_form': 'construct'}]]
[[{'predicate_idx': 1, 'predicate': 'construction', 'verb_form': 'construct'},
{'predicate_idx': 11, 'predicate': 'beginning', 'verb_form': 'begin'},
{'predicate_idx': 14, 'predicate': 'destruction', 'verb_form': 'destruct'}]]
📚 詳細文檔
📄 許可證
文檔中未提及許可證相關信息。
📚 引用
如果你使用了本模型,請引用以下文獻:
@inproceedings{klein2020qanom,
title={QANom: Question-Answer driven SRL for Nominalizations},
author={Klein, Ayal and Mamou, Jonathan and Pyatkin, Valentina and Stepanov, Daniela and He, Hangfeng and Roth, Dan and Zettlemoyer, Luke and Dagan, Ido},
booktitle={Proceedings of the 28th International Conference on Computational Linguistics},
pages={3069--3083},
year={2020}
}