🚀 オランダ語文章の句読点予測モデル
このモデルはオランダ語の文章の句読点を予測します。音声文字起こしの文章の句読点を復元するために開発されました。
このモデルはSoNaRデータセットを使って学習されています。
モデルは以下の句読点を復元します:"." "," "?" "-" ":"
🚀 クイックスタート
📦 インストール
パッケージをpypiからインストールして始めましょう:
pip install deepmultilingualpunctuation
💻 使用例
基本的な使用法
from deepmultilingualpunctuation import PunctuationModel
model = PunctuationModel(model="oliverguhr/fullstop-dutch-sonar-punctuation-prediction")
text = "hervatting van de zitting ik verklaar de zitting van het europees parlement die op vrijdag 17 december werd onderbroken te zijn hervat"
result = model.restore_punctuation(text)
print(result)
出力
hervatting van de zitting. ik verklaar de zitting van het europees parlement, die op vrijdag 17 december werd onderbroken, te zijn hervat.
高度な使用法
from deepmultilingualpunctuation import PunctuationModel
model = PunctuationModel(model="oliverguhr/fullstop-dutch-sonar-punctuation-prediction")
text = "hervatting van de zitting ik verklaar de zitting van het europees parlement die op vrijdag 17 december werd onderbroken te zijn hervat"
clean_text = model.preprocess(text)
labled_words = model.predict(clean_text)
print(labled_words)
出力
[['hervatting', '0', 0.99998724], ['van', '0', 0.9999784], ['de', '0', 0.99991274], ['zitting', '.', 0.6771242], ['ik', '0', 0.9999466], ['verklaar', '0', 0.9998566], ['de', '0', 0.9999783], ['zitting', '0', 0.9999809], ['van', '0', 0.99996245], ['het', '0', 0.99997795], ['europees', '0', 0.9999783], ['parlement', ',', 0.9908242], ['die', '0', 0.999985], ['op', '0', 0.99998224], ['vrijdag', '0', 0.9999831], ['17', '0', 0.99997985], ['december', '0', 0.9999827], ['werd', '0', 0.999982], ['onderbroken', ',', 0.9951485], ['te', '0', 0.9999677], ['zijn', '0', 0.99997723], ['hervat', '.', 0.9957053]]
📚 ドキュメント
結果
単一の句読点マーカーの性能は異なります。多くの場合、ハイフンとコロンはオプションで、カンマまたはピリオドで置き換えることができます。モデルは以下のF1スコアを達成します:
ラベル |
F1スコア |
0 |
0.985816 |
. |
0.854380 |
? |
0.684060 |
, |
0.719308 |
: |
0.696088 |
- |
0.722000 |
マクロ平均 |
0.776942 |
ミクロ平均 |
0.963427 |
言語
モデル
コミュニティモデル
モデルパラメータを設定することで、異なるモデルを使用することができます:
model = PunctuationModel(model = "oliverguhr/fullstop-dutch-punctuation-prediction")
📄 ライセンス
このモデルはMITライセンスの下で提供されています。
引用方法
@misc{https://doi.org/10.48550/arxiv.2301.03319,
doi = {10.48550/ARXIV.2301.03319},
url = {https://arxiv.org/abs/2301.03319},
author = {Vandeghinste, Vincent and Guhr, Oliver},
keywords = {Computation and Language (cs.CL), Artificial Intelligence (cs.AI), FOS: Computer and information sciences, FOS: Computer and information sciences, I.2.7},
title = {FullStop:Punctuation and Segmentation Prediction for Dutch with Transformers},
publisher = {arXiv},
year = {2023},
copyright = {Creative Commons Attribution Share Alike 4.0 International}
}