Skip to content

Commit 3fa15a2

Browse files
committed
Added an example of negation annotation #86
1 parent 568e377 commit 3fa15a2

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

docs/source/modality_annotation.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Specification
2424
:API Class: ``Modality`` (`FoLiApy API Reference <https://foliapy.readthedocs.io/en/latest/_autosummary/folia.main.Modality.html>`_)
2525
:Layer Element: ``<modalities>``
2626
:Span Role Elements: ``<cue>`` (``Cue``), ``<scope>`` (``Scope``), ``<source>`` (``Source``), ``<target>`` (``Target``)
27-
:Required Attributes:
27+
:Required Attributes:
2828
:Optional Attributes: * ``xml:id`` -- The ID of the element; this has to be a unique in the entire document or collection of documents (corpus). All identifiers in FoLiA are of the `XML NCName <https://www.w3.org/TR/1999/WD-xmlschema-2-19990924/#NCName>`_ datatype, which roughly means it is a unique string that has to start with a letter (not a number or symbol), may contain numbers, but may never contain colons or spaces. FoLiA does not define any naming convention for IDs.
2929
* ``set`` -- The set of the element, ideally a URI linking to a set definition (see :ref:`set_definitions`) or otherwise a uniquely identifying string. The ``set`` must be referred to also in the :ref:`annotation_declarations` for this annotation type.
3030
* ``class`` -- The class of the annotation, i.e. the annotation tag in the vocabulary defined by ``set``.
@@ -71,8 +71,16 @@ Besides these predefined features, FoLiA's feature mechanism can be used to asso
7171
Example
7272
-------------------------
7373

74+
An example of sentiment analysis:
75+
7476
.. literalinclude:: ../../examples/modality-sentiments.2.4.0.folia.xml
7577
:linenos:
7678
:language: xml
7779

80+
An example of negation annotation:
81+
82+
.. literalinclude:: ../../examples/modality-negation.2.4.0.folia.xml
83+
:linenos:
84+
:language: xml
85+
7886

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FoLiA xmlns="http://ilk.uvt.nl/folia" version="2.0" xml:id="example">
3+
<metadata>
4+
<annotations>
5+
<token-annotation set="https://raw.githubusercontent.com/LanguageMachines/uctodata/master/setdefinitions/tokconfig-eng.foliaset.ttl">
6+
<annotator processor="p1" />
7+
</token-annotation>
8+
<text-annotation>
9+
<annotator processor="p1" />
10+
</text-annotation>
11+
<sentence-annotation>
12+
<annotator processor="p1" />
13+
</sentence-annotation>
14+
<modality-annotation set="modalities"> <!-- an ad-hoc set -->
15+
<annotator processor="p1" />
16+
</modality-annotation>
17+
</annotations>
18+
<provenance>
19+
<processor xml:id="p1" name="proycon" type="manual" />
20+
</provenance>
21+
</metadata>
22+
<text xml:id="example.text">
23+
<s xml:id="s1">
24+
<w xml:id="s1.w1"><t>I</t></w>
25+
<w xml:id="s1.w2"><t>did</t></w>
26+
<w xml:id="s1.w3"><t>not</t></w>
27+
<w xml:id="s1.w4"><t>know</t></w>
28+
<w xml:id="s1.w5"><t>who</t></w>
29+
<w xml:id="s1.w6"><t>you</t></w>
30+
<w xml:id="s1.w7"><t>were</t></w>
31+
<modalities>
32+
<modality class="negation">
33+
<cue>
34+
<wref id="s1.w3" t="not" />
35+
</cue>
36+
<scope>
37+
<wref id="s1.w1" t="I" />
38+
<wref id="s1.w2" t="did" />
39+
<wref id="s1.w4" t="know" />
40+
<wref id="s1.w5" t="who" />
41+
<wref id="s1.w6" t="you" />
42+
<wref id="s1.w7" t="were" />
43+
</scope>
44+
</modality>
45+
</modalities>
46+
</s>
47+
</text>
48+
</FoLiA>

0 commit comments

Comments
 (0)