0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ポルトガル語品詞付与・係り受け解析モデルmodernbert-base-portuguese-ud-embedsリリース

Posted at

8月19日の記事の続きだが、ModernBERT-base-portugueseをもとに、ポルトガル語品詞付与・係り受け解析モデルmodernbert-base-portuguese-ud-embedsを作ってみた。Google Colaboratoryで動かしてみよう。

!pip install transformers deplacy
from transformers import pipeline
nlp=pipeline("universal-dependencies","KoichiYasuoka/modernbert-base-portuguese-ud-embeds",trust_remote_code=True)
doc=nlp("Foi quebrado pelo pelo do gato")
import deplacy
deplacy.serve(doc,port=None)

Foi quebrado pelo pelo do gato」を係り受け解析してみたところ、私(安岡孝一)の手元では以下の結果が得られた。

# text = Foi quebrado pelo pelo do gato
1	Foi	_	AUX	_	Mood=Ind|Number=Sing|Person=3|Tense=Past|VerbForm=Fin	2	aux:pass	_	_
2	quebrado	_	VERB	_	Gender=Masc|Number=Sing|VerbForm=Part|Voice=Pass	0	root	_	_
3-4	pelo	_	_	_	_	_	_	_	_
3	por	_	ADP	_	_	5	case	_	_
4	o	_	DET	_	Definite=Def|Gender=Masc|Number=Sing|PronType=Art	5	det	_	_
5	pelo	_	NOUN	_	Gender=Masc|Number=Sing	2	obl:agent	_	_
6-7	do	_	_	_	_	_	_	_	_
6	de	_	ADP	_	_	8	case	_	_
7	o	_	DET	_	Definite=Def|Gender=Masc|Number=Sing|PronType=Art	8	det	_	_
8	gato	_	NOUN	_	Gender=Masc|Number=Sing	5	nmod	_	SpaceAfter=No

pt.png

1つ目の「pelo」は縮約冠詞として「por」「o」に分けて処理されている。一方、2つ目の「pelo」は名詞だと判断されている。その次の「do」は縮約冠詞として「de」「o」に分けて処理されている。このあたりのチューニングに注力したとはいえ、非常に満足できる出来ばえだ。ModernBERTの面目躍如ということだろう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?