UniversalDependencies / UD_Portuguese-Bosque

This Universal Dependencies (UD) Portuguese treebank.
Other
48 stars 11 forks source link

inconsistency on telephone number #77

Open livyreal opened 7 years ago

livyreal commented 7 years ago

Some telephone numbers are tagged as mwe (note the wrong POS of (011)).

 id="141" ref="CF35-7" source="CETENFolha n=35 cad=Folhateen sec=soc sem=94a" forest="1" text="Informações pelo (011) 263-4700."

2   por por ADP <sam->|PRP|@N<  _   1   case    _   _
3   o   o   DET <first-cjt>|<artd>|<-sam>|ART|M|S|@>N   PronType=Art|Gender=Masc|Number=Sing|Definite=Def   1   det _   _
4   (011)   (011)   ADP PRP|@P< _   1   nmod    _   MWE:(011)=263-4700
5   263-4700    263-4700    NUM NUM|@A< _   1   mwe _   _

Some of them are annotated as NUM

id="2819" ref="CF670-17" source="CETENFolha n=670 cad=Brasil sec=pol sem=94b" forest="1" text="Para contatos telefônicos, ligue (011) 224-3896 entre 14h e 18h, de segunda a sexta-feira."

1   Para    para    ADP PRP|@ADVL>  _   2   case    _   _
2   contatos    contato NOUN    <np-idf>|N|M|P|@P<  Gender=Masc|Number=Plur 5   nmod    _   _
3   telefônicos telefônico  ADJ ADJ|M|P|@N< Gender=Masc|Number=Plur 2   amod    _   _
4   ,   ,   PUNCT   PU|@PU  _   2   punct   _   _
5   ligue   ligar   VERB    <mv>|V|PR|1/3S|SUBJ|@FS-STA VerbForm=Fin|Mood=Sub|Tense=Pres|Number=Sing    0   root    _   _
6   (   (   PUNCT   PU|@PU  _   7   punct   _   _
7   011 011 NUM <card>|NUM|M/F|P|@>N    _   9   nummod  _   _
8   )   )   PUNCT   PU|@PU  _   7   punct   _   _
9   224-3896    224-3896    NUM <card>|NUM|M/F|P|@<ACC  _   5   dobj    _   _

Following guidelines for NUM and SYM it is not clear to me how we should tag them.

claudiafreitas commented 7 years ago

@livyreal The english corpus uses NUM. I vote for following the en-corpus, but expliciting the decision (and the arguments that support it (the en-corpus)) in our guidelines..

11  (   (   PUNCT   -LRB-   _   14  punct   _   SpaceAfter=No
12  713 713 NUM CD  NumType=Card    14  nummod  _   SpaceAfter=No
13  )   )   PUNCT   -RRB-   _   14  punct   _   _
14  345-9945    345-9945    NUM CD  NumType=Card    9   appos   _   _
15  Fax fax NOUN    NN  Number=Sing 2   list    _   SpaceAfter=No
16  :   :   PUNCT   :   _   15  punct   _   _
17  (   (   PUNCT   -LRB-   _   20  punct   _   SpaceAfter=No
18  713 713 NUM CD  NumType=Card    20  nummod  _   SpaceAfter=No
19  )   )   PUNCT   -RRB-   _   20  punct   _   _
20  646-8420    646-8420    NUM CD  NumType=Card    15  appos   _   _
livyreal commented 7 years ago

great, I vote for following them too. We then agree for keeping NUM and not symbol.

But check the tokenization.

6 800.713.8600 800.713.8600 NUM CD NumType=Card 0 root _ SpaceAfter=No 6 800/711-8000 800/711-8000 NUM CD NumType=Card 4 appos _ _

13  202.582.1234    202.582.1234    NUM CD  NumType=Card    11  appos   _   _
14  or  or  CONJ    CC  _   13  cc  _   _
15  1.800.233.1234  1.800.233.1234  NUM CD  NumType=Card    13  conj    _   _
20  1   1   NUM CD  NumType=Card    25  compound    _   _
21  800 800 NUM CD  NumType=Card    25  compound    _   _
22  451 451 NUM CD  NumType=Card    25  compound    _   _
23  0491    0491    NUM CD  NumType=Card    25  compound    _   _
24  (   (   PUNCT   -LRB-   _   25  punct   _   SpaceAfter=No
25  0448    0448    NUM CD  NumType=Card    19  appos   _   SpaceAfter=No
26  )   )   PUNCT   -RRB-   _   25  punct   _   _
27  Office  office  NOUN    NN  Number=Sing 5   parataxis   _   _
28  979 979 NUM CD  NumType=Card    30  compound    _   _
29  238 238 NUM CD  NumType=Card    30  compound    _   _
30  2102    2102    NUM CD  NumType=Card    27  appos   _   _
31  Home    home    NOUN    NN  Number=Sing 5   list    _   _
32  979 979 NUM CD  NumType=Card    34  compound    _   _
33  548 548 NUM CD  NumType=Card    34  compound    _   _
34  7034    7034    NUM CD  NumType=Card    31  appos   

There is no consistency about tokens span. Should we decide for one way to tag or it is a very small issue? I'd prefer to do not split telephone numbers, even if they appear with parentheses, dots or bars.

vcvpaiva commented 7 years ago

@livyreal one problem is that we don't seem to have the subtype NumType=Card or Ord or Digits anymore, #79. so all numbers are failing the tests.

livyreal commented 7 years ago

the EN corpus tagged them are NumType=Card. we can add it to all NUM that are telephones, besides I do not agree that this is a good feature NumType. I'd prefer something as NumType=Tel but it is not pure syntax.

livyreal commented 7 years ago

it seems a good solution is keeping the tokenization (that is: break the telephone numbers with parentheses, but do not break telephone numbers with dot or slash:

24  (   (   PUNCT   -LRB-   _   25  punct   _   SpaceAfter=No
25  0448    0448    NUM CD  NumType=Card    19  appos   _   SpaceAfter=No
26  )   )   PUNCT   -RRB-   _   25  punct   _   _

800/711-8000 800/711-8000 NUM CD NumType=Card 4 appos _ _ 

) and tag all of them as NUM NumType=Card. It could be done automatically.

vcvpaiva commented 7 years ago

I also agree that "tagging all of them as NUM and NumType=Card" is the best bet. (not so sure about how the tokenization should go, as I have not looked into it. also not so sure how automatic this can be done, but surely some of it can be automatic, one hopes.)

MCGoes commented 7 years ago

Então ficamos com NumType=Card,Tel --> é preciso documentar. Quanto à tokenização, o ideal seria ter o número completo em uma linha, incluindo DDD e pontuação. É possível, @arademaker ?

livyreal commented 7 years ago

CF558-3

25  os  o   DET <-sam>|<artd>|ART|M|P|@>N   Definite=Def|Gender=Masc|Number=Plur|PronType=Art   26  det _   _
26  telefones   telefone    NOUN    <np-def>|N|M|P|@P<  Gender=Masc|Number=Plur 15  nmod    _   _
27  (   (   PUNCT   PU|@PU  _   28  punct   _   _
28  011 011 NUM <card>|NUM|M|P|@N<PRED  _   26  appos   _   _
29  )   )   PUNCT   PU|@PU  _   28  punct   _   _
30  231-5346    231-5346    NUM <first-cjt>|<card>|NUM|M|P|@N<  _   26  nummod  _   _
31  e   e   CONJ    <co-postnom>|KC|@CO _   30  cc  _   _
32  288-3514    288-3514    NUM <cjt>|<card>|NUM|M/F|P|@N<  _   

Nós achamos que o melhor jeito de tokenizar números de telefone é deixando toda a informação em uma única linha: pontuação, dd e número, quando houver. Assim o exemplo acima ficaria:

25  os  o   DET <-sam>|<artd>|ART|M|P|@>N   Definite=Def|Gender=Masc|Number=Plur|PronType=Art   26  det _   _
26  telefones   telefone    NOUN    <np-def>|N|M|P|@P<  Gender=Masc|Number=Plur 15  nmod    _   _
27  (011) 231-5346  (011) 231-5346  NUM _ _ 26  appos   _   _
28  e   e   CONJ    <co-postnom>|KC|@CO _   27  cc  _   _
29  288-3514    288-3514    NUM <cjt>|<card>|NUM|M/F|P|@N<  _   

É possível fazer, @arademaker ?

Nós também decidimos que vamos ter a feature NumType:Tel já que números de telefone não são bem números e funcionam sintaticamente como nomes.

claudiafreitas commented 7 years ago

isso. E @arademaker , crisgóes era eu, que nao percebi que estava na conta dela.

livyreal commented 7 years ago

Ainda prefiro a solução acima (tokenizar telefones em uma linha apenas), mas se não for possível, me parece que a relação adequada agora seria flat e não mais mwe.

"A new relation flat is added for semi-fixed multiword expressions for which there is no clear evidence that one of the components is the linguistic head. This covers the originally intended uses of the name and foreign relations but also other cases like title-name combinations and date expressions that do not have a clear endocentric syntactic structure. Subtypes like flat:name and flat:foreign can be used to preserve information in existing treebanks." from: http://universaldependencies.org/v2/summary.html

arademaker commented 7 years ago

para tokenizar '(011) 231-5346' como uma coisa só, teriamos que introduzir o underscore para o arquivo permanecer válido. Acho que o melhor é marcar com name:flat.

livyreal commented 7 years ago

se não dá para tokenizar tudo numa linha só, vamos ter o problema de uniformizar as ocorrências:

CF35-7
4   (011)   (011)   ADP PRP|@P< _   1   nmod    _   MWE=(011)_263-4700
5   263-4700    263-4700    NUM NUM|@A< _   1   mwe _   _

mas

CF759-5
17  (   (   PUNCT   PU|@PU  _   18  punct   _   _
18  tel.    tel.    NOUN    <first-cjt>|<np-idf>|N|M|S|@N<PRED  Gender=Masc|Number=Sing 16  appos   _   _
19  011/253-1588    011/253-1588    NUM <card>|NUM|M|P|@N<  _   18  nummod  _   _
20  )   )   PUNCT   PU|@PU  _   18  punct   _   _

Por mais que o tratamento em inglês não esteja uniforme, me parece claro que as guidelines indicam:

11  (   (   PUNCT   -LRB-   _   14  punct   _   SpaceAfter=No
12  713 713 NUM CD  NumType=Card    14  nummod  _   SpaceAfter=No
13  )   )   PUNCT   -RRB-   _   14  punct   _   _
14  345-9945    345-9945    NUM CD  NumType=Card    9   appos   _   _
15  Fax fax NOUN    NN  Number=Sing 2   list    _   SpaceAfter=No
16  :   :   PUNCT   :   _   15  punct   _   _
17  (   (   PUNCT   -LRB-   _   20  punct   _   SpaceAfter=No
18  713 713 NUM CD  NumType=Card    20  nummod  _   SpaceAfter=No
19  )   )   PUNCT   -RRB-   _   20  punct   _   _
20  646-8420    646-8420    NUM CD  NumType=Card    15  appos   _   _

Isso é, quebrar os parenteses e marcá-los como PUNCT/punct.

Isso daria muito trabalho, não @arademaker ? E sinceramente, pouco ganho na informação do corpus, a estrutura dos números de telefone não é relevante e os parenteses aí menos ainda.

arademaker commented 7 years ago

@livyreal vamos deixar isso como baixa prioridade? Temos

$ awk '$2 ~ /^[0-9\-\/]{5,}$/ { print $4,$8}' *conllu | sort -n | uniq -c
   2 NOUN appos
   2 NOUN nmod
   1 NOUN nmod:npmod
   6 NUM appos
   1 NUM ccomp
   3 NUM conj
   1 NUM dep
   6 NUM fixed
  14 NUM nmod
  13 NUM nummod
   1 NUM obj
   1 NUM root
   1 PROPN appos
   1 PROPN flat:name
   1 PROPN nmod

54 casos de tokens com wordform sendo 4 ou mais números ou "/" ou "-"

arademaker commented 3 years ago

what about times:

% awk '$2 ~ /^[0-9]+h[0-9]+m?$/' *.conllu | head
19  22h30   22h30   NOUN    <np-def>|N|F|P|@P<  Gender=Fem|Number=Plur  14  obl _   SpaceAfter=No
11  20h30   20h30   NOUN    <np-idf>|N|F|P|@N<PRED  Gender=Fem|Number=Plur  1   parataxis   _   SpaceAfter=No
24  8h30    8h30    NOUN    <np-def>|N|F|P|@P<  Gender=Fem|Number=Plur  3   obl _   _
27  14h30   14h30   NOUN    <np-idf>|N|F|P|@N<PRED  Gender=Fem|Number=Plur  24  appos   _   _
9   16h30   16h30   NOUN    <np-def>|N|F|P|@P<  Gender=Fem|Number=Plur  6   obl _   _
18  15h30   15h30   NOUN    <np-def>|N|F|P|@P<  Gender=Fem|Number=Plur  15  obl _   SpaceAfter=No
13  17h45   17h45   NOUN    <np-def>|N|F|P|@P<  Gender=Fem|Number=Plur  3   obl _   SpaceAfter=No
7   22h10   22h10   NOUN    <np-def>|N|F|P|@P<  Gender=Fem|Number=Plur  3   obl _   SpaceAfter=No
3   11h30   11h30   NOUN    <np-def>|N|F|P|@P<  Gender=Fem|Number=Plur  21  obl _   _
5   5h25    5h25    NOUN    <np-def>|N|F|P|@P<  Gender=Fem|Number=Plur  2   obl _   _
(venv) ar@leme documents % awk '$2 ~ /^[0-9]+h[0-9]+m?$/' *.conllu | wc -l
      83