2014-04-24 2 views
0

스페인어에 대한 타거 성능 comparisson을 만들려고합니다. 현재 스크립트는 this의 수정 된 버전입니다. althoug와 비슷한 결과를 가진 다른 버전을 시도했습니다.NLTK 스페인어 타거스 결과가 정말 안좋은가요?

저는 cess_esp corpus를 사용하고 있으며 태그 화 된 문장을 사용하여 각 태그 작성자를 교육하기 위해이 자료에 대한 Unigram, Bigram, Trigram 및 Brill 태그 작성기를 작성했습니다.

저는 Bigram, Trigram taggers의 성능에 대해 우려하고 있습니다. 결과에서 AT 모두 작동하지 않는 것 같습니다. 이제 음절과 괘는 방법입니다 표시된 링크로 훈련되고

*************** START TAGGING FOR LINE 6 **************************************************************************************************************************************** 

Current line contents before tagging-> mejor ve a la sucursal de Juan Pablo II es la que menos gente tiene y no te tardas nada 

Unigram tagger-> [('@yadimota', None), ('@ContactoBanamex', None), ('mejor', 'aq0cs0'), ('ve', 'vmip3s0'), ('a', 'sps00'), ('la', 'da0fs0'), ('sucursal', 'ncfs000'), ('de', 'sps00'), ('Juan', 'np0000p'), ('Pablo', None), ('II', None), ('es', 'vsip3s0'), ('la', 'da0fs0'), ('que', 'pr0cn000'), ('menos', 'rg'), ('gente', 'ncfs000'), ('tiene', 'vmip3s0'), ('y', 'cc'), ('no', 'rn'), ('te', 'pp2cs000'), ('tardas', None), ('nada', 'pi0cs000')] 

Bigram tagger-> [('@yadimota', None), ('@ContactoBanamex', None), ('mejor', None), ('ve', None), ('a', None), ('la', None), ('sucursal', None), ('de', None), ('Juan', None), ('Pablo', None), ('II', None), ('es', None), ('la', None), ('que', None), ('menos', None), ('gente', None), ('tiene', None), ('y', None), ('no', None), ('te', None), ('tardas', None), ('nada', None)] 

Trigram tagger-> [('@yadimota', None), ('@ContactoBanamex', None), ('mejor', None), ('ve', None), ('a', None), ('la', None), ('sucursal', None), ('de', None), ('Juan', None), ('Pablo', None), ('II', None), ('es', None), ('la', None), ('que', None), ('menos', None), ('gente', None), ('tiene', None), ('y', None), ('no', None), ('te', None), ('tardas', None), ('nada', None)] 
**************************************************************************************************************************************** 

*************** START TAGGING FOR LINE 7 **************************************************************************************************************************************** 

Current line contents before tagging-> He levantado ya varios reporte pero no resuelven nada 

Unigram tagger-> [('He', 'vaip1s0'), ('levantado', 'vmp00sm'), ('ya', 'rg'), ('varios', 'di0mp0'), ('reporte', 'vmsp1s0'), ('pero', 'cc'), ('no', 'rn'), ('resuelven', None), ('nada', 'pi0cs000')] 

Bigram tagger-> [('He', None), ('levantado', None), ('ya', None), ('varios', None), ('reporte', None), ('pero', None), ('no', None), ('resuelven', None), ('nada', None)] 

Trigram tagger-> [('He', None), ('levantado', None), ('ya', None), ('varios', None), ('reporte', None), ('pero', None), ('no', None), ('resuelven', None), ('nada', None)] 

*************** START TAGGING FOR LINE 8 **************************************************************************************************************************************** 

Current line contents before tagging-> Es lamentable el servicio que brindan 

Unigram tagger-> [('@ContactoBanamex', None), ('Es', 'vsip3s0'), ('lamentable', 'aq0cs0'), ('el', 'da0ms0'), ('servicio', 'ncms000'), ('que', 'pr0cn000'), ('brindan', None)] 

Bigram tagger-> [('@ContactoBanamex', None), ('Es', None), ('lamentable', None), ('el', None), ('servicio', None), ('que', None), ('brindan', None)] 

Trigram tagger-> [('@ContactoBanamex', None), ('Es', None), ('lamentable', None), ('el', None), ('servicio', None), ('que', None), ('brindan', None)] 

, 더 정직 식으로에 도시 된 바와 같이

:

예를 들어

, 여기에 내 스크립트의 일부 출력 NLTK 도서 :

from nltk.corpus import cess_esp as cess 
from nltk import BigramTagger as bt 
from nltk import TrigramTagger as tt 
cess_sents = cess.tagged_sents() 
# Training BigramTagger. 
bi_tag = bt(cess_sents) 
#Training TrigramTagger 
tri_tag = tt(cess_sents) 

내가 여기에 뭔가 빠진다면 어떤 생각이라도 있니? bigram과 trigram이 unigram보다 잘 작동하지 않아야합니까? 나는 bigram adn trigram을 위해 항상 backoff tagger를 사용해야합니까?

감사합니다. 알레한드로

답변

1

NLTK 코퍼스 및 태그 지정 모듈을 사용하여 확장 가능한 태그 작성기를 쉽게 만드는 방법에 대한 간단한 자습서로 스파게티 태그 붙이기 (https://code.google.com/p/spaghetti-tagger/)가 만들어졌습니다.

사이트에서 제안한대로 최첨단 시스템을 의미하지 않습니다. http://nlp.lsi.upc.edu/freeling/과 같은 최첨단 타거스를 사용하는 것이 좋습니다. Freeling을 위해 파이썬에서 적절한 래퍼 클래스를 작성해 드리겠습니다. 위로 질문에

, 프랜시스가 암시 한대로 ( https://groups.google.com/forum/#!topic/nltk-users/FtqksaZLLvY), 첫번째 은 다음 backoff 매개 변수 문제

책임의 한계와 법적 고지 해결 수있는 것을 볼 수, 튜토리얼 http://nltk.googlecode.com/svn/trunk/doc/howto/tag.html을 통해 이동 : 나는 스파게티를 썼다. py https://spaghetti-tagger.googlecode.com/svn/spaghetti.py

+0

안녕하세요 Alvas은, 예,를 작성 주셔서 감사합니다. unigram과 bigram을 사용한다면 스파게티 타거라는 이유는 무엇입니까? http://nltk.googlecode.com/svn/trunk/doc/howto/tag.html 및 http://www.nltk.org/book/ch05.html에서 링크를 따라갔습니다. 실제로 나는 unigram을위한 bigram backoff tagger와 trigram과 결과를위한 bigram backoff tagger를 포함하도록 스크립트를 수정했습니다. 나는 또한 트레이너로 unigram과 브릴 태거를 사용하고 작동하는 것. 나는 Freeling과 TreeTagger를 보았습니다. 그러나 파이썬이 아니기 때문에 파이썬에서 Freeling을위한 래퍼를 가지고 있다면 그것을 버립니다! – AlejandroVK

+0

코드를 제대로 살펴 보면 피클과 mwe 태그가 포함 된 트릭이 있습니다. NLTK를 사용하여 더 확장 성이 좋은 태그 작성기에 대한 일종의 무료 튜토리얼 일뿐입니다. 몇 가지 무료 래퍼 (https://www.google.com/search?q=freeling+python)가 있습니다.나는 자유로운 경우에 하나를 쓰겠습니다. =) – alvas

+0

안녕하세요, 포트가있는 것 같습니다. 체크 아웃 할 것입니다. http://www.ohloh.net/p/freeling-python – AlejandroVK

1

제이콥 퍼킨스의 NLTK POS 태그 지정 블로그 게시물은 아마 더 나은 온라인 자료 중 하나라고 생각합니다. 그는 간단한 backoff ngram tagger를 작성한 다음 regexes 및 affix 기반 태깅을 추가 한 다음 Brill 태깅을 수행 한 다음 full-on classifier 기반 태깅을 추가합니다. 게시물은 명확하고 쉽게 추적 할 수 있으며 몇 가지 유용한 성능 비교를 포함합니다.

시작 여기 제 4 부에 끝까지 : http://streamhacker.com/2008/11/03/part-of-speech-tagging-with-nltk-part-1/

+1

와우, 매우 유용한 링크, 감사합니다! – AlejandroVK