• Aucun résultat trouvé

Annotating Text With Local Grammars

N/A
N/A
Protected

Academic year: 2022

Partager "Annotating Text With Local Grammars"

Copied!
43
0
0

Texte intégral

(1)

June 2, 2016 DICORA Korea

Annotating Text

With Local Grammars

(2)

Annotating Text With Local Grammars • 2 2016/06/02

Annotating Text

With Local Grammars

Unitex/GramLab provides tools for inserting and modifying annotations in text

How to insert annotations?

How to copy information into annotations?

Where to place annotations?

How to delete annotations?

(3)

Outline

Insert annotations

Copy from text to annotation Copy from a dictionary

Annotate at the right place

Delete annotations

(4)

Annotating Text With Local Grammars • 4 2016/06/02

Inserting annotations

It worked for my mental health better than any other drug

<opinion>It worked for my mental health better than any other drug</opinion>

Box output

(5)

Inserting annotations

Check the 'Merge with input text' option of Text >

Locate Pattern

By default, box outputs are ignored It worked for my mental health better than any other drug

<opinion>It worked for my mental health better than any other drug</opinion>

(6)

Annotating Text With Local Grammars • 6 2016/06/02

Inserting annotations

Clearly distinguish annotations from the original corpus XML tags are a good solution for that

They are delimited by < > which are rarely used in normal text

Occurrences of '<' in the original text may be replaced by

&lt;

It worked for my mental health better than any other drug

<opinion>It worked for my mental health better than any other drug</opinion>

(7)

Outline

Insert annotations

Copy from text to annotation Copy from a dictionary

Annotate at the right place

Delete annotations

(8)

Annotating Text With Local Grammars • 8 2016/06/02

Copy from text to annotation

It worked for me better than any other drug

<opinion>It worked for me better than any other drug<comp phrase='better'/></opinion>

(9)

Copy from text to annotation

It worked for me better than any other drug

<opinion>It worked for me better than any other drug<comp phrase='better'/></opinion>

Copy from the text to an input variable

(10)

Annotating Text With Local Grammars • 10 2016/06/02

Copy from text to annotation

It worked for me better than any other drug

<opinion>It worked for me better than any other drug<comp phrase='better'/></opinion>

Copy from the input variable into an annotation

(11)

Insert a modified copy

It worked for me better than any other drug

<opinion>It worked for me better than any other drug<content polarity='good'/></opinion>

(12)

Annotating Text With Local Grammars • 12 2016/06/02

Insert a modified copy

It worked for me better than any other drug

<opinion>It worked for me better than any other drug<content polarity='good'/></opinion>

Specify the modified copies in box outputs

(13)

Insert a modified copy

It worked for me better than any other drug

<opinion>It worked for me better than any other drug<content polarity='good'/></opinion>

Copy box outputs to an output variable

(14)

Annotating Text With Local Grammars • 14 2016/06/02

Insert a modified copy

It worked for me better than any other drug

<opinion>It worked for me better than any other drug<content polarity='good'/></opinion>

Copy from the output variable into an annotation

(15)

Outline

Insert annotations

Copy from text to annotation Copy from a dictionary

Annotate at the right place

Delete annotations

(16)

Annotating Text With Local Grammars • 16 2016/06/02

Copy from a dictionary

It worked for my mental health quite poorly

<opinion>It worked for my mental health quite poorly<content polarity='bad'/></opinion>

inefficiently,.ADV+opinion+pol=bad poorly,.ADV+opinion+pol=bad

satisfactorily,.ADV+opinion+pol=good

(17)

Copy from a dictionary

It worked for my mental health quite poorly

<opinion>It worked for my mental health quite poorly<content polarity='bad'/></opinion>

inefficiently,.ADV+opinion+pol=bad poorly,.ADV+opinion+pol=bad

satisfactorily,.ADV+opinion+pol=good

Copy from the entries to a dictionary-entry variable

(18)

Annotating Text With Local Grammars • 18 2016/06/02

Copy from a dictionary

It worked for my mental health quite poorly

<opinion>It worked for my mental health quite poorly<content polarity='bad'/></opinion>

Copy from the dictionary-entry variable into an annotation inefficiently,.ADV+opinion+pol=bad

poorly,.ADV+opinion+pol=bad

satisfactorily,.ADV+opinion+pol=good

(19)

Dictionary-entry variables

Graphs with dictionary-entry variables must be applied:

- to the text automaton

- with the 'automaton intersection' option of Locate Pattern

(20)

Annotating Text With Local Grammars • 20 2016/06/02

Dictionary-entry variables

Graphs with dictionary-entry variables must be applied:

- to the text automaton

- with the 'automaton intersection' option of Locate Pattern

(21)

Dictionary-entry variables in the morphological mode

Graphs with dictionary-entry variables can also be applied without constructing the text automaton, but with other conventions

(22)

Annotating Text With Local Grammars • 22 2016/06/02

Dictionary-entry variables in the morphological mode

It worked for my mental health quite poorly

<opinion>It worked for my mental health quite poorly<content polarity='bad'/></opinion>

inefficiently,.ADV+opinion+pol=bad poorly,.ADV+opinion+pol=bad

satisfactorily,.ADV+opinion+pol=good

(23)

Dictionary-entry variables in the morphological mode

Declare the dictionary among the

morphological-mode dictionaries in the Info > Preferences menu

It worked for my mental health quite poorly

<opinion>It worked for my mental health quite poorly<content polarity='bad'/></opinion>

inefficiently,.ADV+opinion+pol=bad poorly,.ADV+opinion+pol=bad

satisfactorily,.ADV+opinion+pol=good

(24)

Annotating Text With Local Grammars • 24 2016/06/02

Dictionary-entry variables in the morphological mode

It worked for my mental health quite poorly

<opinion>It worked for my mental health quite poorly<content polarity='bad'/></opinion>

inefficiently,.ADV+opinion+pol=bad poorly,.ADV+opinion+pol=bad

satisfactorily,.ADV+opinion+pol=good

Copy from the entries to a dictionary-entry variable Enter the morphological mode

(25)

Dictionary-entry variables in the morphological mode

It worked for my mental health quite poorly

<opinion>It worked for my mental health quite poorly<content polarity='bad'/></opinion>

inefficiently,.ADV+opinion+pol=bad poorly,.ADV+opinion+pol=bad

satisfactorily,.ADV+opinion+pol=good

Copy from the dictionary-entry variable into an annotation

(26)

Outline

Annotating Text With Local Grammars • 26 2016/06/02

Insert annotations

Copy from text to annotation Copy from a dictionary

Annotate at the right place

Delete annotations

(27)

Annotate at the right place

In XML, attributes are obligatorily placed in start tags This implies we copy information to output in a different

order than in input

It worked for me better than any other drug

<opinion>It worked for me better than any other drug<comp phrase='better'/></opinion>

It worked for me better than any other drug

<opinion phrase='better'>It worked for me better than any other drug</opinion>

attribute start tag

(28)

Annotating Text With Local Grammars • 28 2016/06/02

The 'Merge with input text' mode

All the preceding examples were with the Merge mode In this mode, Unitex tacitly copies the text it recognizes This is simple but does not copy in a different order We want to make copy explicit

It worked for me badly and I stopped after three months

<opinion>It worked for me badly</opinion> and I stopped after three months

(29)

The 'Replace recognized sequences' mode

Recognized sequences are replaced by outputs It worked for me badly and I stopped after three months

<opinion>It worked for me badly</opinion> and I stopped after three months

(30)

Annotating Text With Local Grammars • 30 2016/06/02

The 'Replace recognized sequences' mode

It worked for me badly and I stopped after three months

<opinion>It worked for me badly</opinion> and I stopped after three months

Explicitly copy from the text to an input variable

(31)

The 'Replace recognized sequences' mode

It worked for me badly and I stopped after three months

<opinion>It worked for me badly</opinion> and I stopped after three months

Explicitly copy from the input variable to the output text

(32)

Annotating Text With Local Grammars • 32 2016/06/02

Copy into an annotation placed before

A local grammar must set a variable before it uses it This solution will not work

It worked for me better than any other drug

<opinion phrase='better'>It worked for me better than any other drug</opinion>

Place to use the variable

Place to set the variable

(33)

Copy into an annotation placed before

It worked for me better than any other drug

<opinion phrase='better'>It worked for me better than any other drug</opinion>

(34)

Annotating Text With Local Grammars • 34 2016/06/02

Copy into an annotation placed before

It worked for me better than any other drug

<opinion phrase='better'>It worked for me better than any other drug</opinion>

(35)

Copy into an annotation placed before

It worked for me better than any other drug

<opinion phrase='better'>It worked for me better than any other drug</opinion>

(36)

Annotating Text With Local Grammars • 36 2016/06/02

Insert a modified copy

into an annotation placed before

It worked for me better than any other drug

<opinion polarity='good'>It worked for me better than any other drug</opinion>

(37)

Insert a modified copy

into an annotation placed before

It worked for me better than any other drug

<opinion polarity='good'>It worked for me better than any other drug</opinion>

(38)

Annotating Text With Local Grammars • 38 2016/06/02

Copy from a dictionary

into an annotation placed before

It worked for my mental health quite poorly

<opinion polarity='bad'>It worked for my mental health quite poorly</opinion>

inefficiently,.ADV+opinion+pol=bad poorly,.ADV+opinion+pol=bad

satisfactorily,.ADV+opinion+pol=good

(39)

Copy from a dictionary

into an annotation placed before

It worked for my mental health quite poorly

<opinion polarity='bad'>It worked for my mental health quite poorly</opinion>

inefficiently,.ADV+opinion+pol=bad poorly,.ADV+opinion+pol=bad

satisfactorily,.ADV+opinion+pol=good

(40)

Outline

Annotating Text With Local Grammars • 40 2016/06/02

Insert annotations

Copy from text to annotation Copy from a dictionary

Annotate at the right place

Delete annotations

(41)

Delete annotations

Clearly distinguish annotations from text

They can be deleted so as to retrieve the original corpus It worked for my mental health better than any other drug

<opinion polarity='good'>It worked for my mental health better than any other drug</opinion>

(42)

Annotating Text With Local Grammars • 42 2016/06/02

Delete annotations

Use a graph that recognizes tags Use it in the Replace mode

Recognized sequences are replaced by outputs

If there are no outputs, recognized sequences are skipped

It worked for my mental health better than any other drug

<opinion polarity='good'>It worked for my mental health better than any other drug</opinion>

(43)

CONTACT

ÉRIC LAPORTE

Thanks

Références

Documents relatifs

dans la balise du paragraphe (méthode sans fichier css) pour changer la couleur du mot test en rouge… puis affecter la classe soustitrecolor à la balise. &lt;p&gt; en

I, Elda de Carvalho, as the coordinator of Moris Foun Group, which weave Tais in Uani Uma Village, declare that our group is surely ready that we agree to the government’s program and

Ecrire une fonction ´ int simul(int m) qui compare le nombre de couleurs utilis´ ees par l’algo exact et par DSATUR pour colorier m graphes al´ eatoires pour n et p fix´

a - Choisir des 7 mots de telle sorte qu'ils ontiennent tous les aratères aentués possibles. b - Erire une page HTML ontenant une ou deux phrases onstitués des

[r]

[r]

[r]

[r]