-
Notifications
You must be signed in to change notification settings - Fork 3
/
outils_corpus-4.html
314 lines (307 loc) · 13.3 KB
/
outils_corpus-4.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="author" content="[email protected]">
<title>Outils de corpus – 4</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="files/reveal.js/css/reveal.css">
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<style type="text/css">
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource a.sourceLine
{ position: relative; left: -4em; }
pre.numberSource a.sourceLine::before
{ content: attr(data-line-number);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; pointer-events: all; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<link rel="stylesheet" href="files/reveal.js/css/theme/white.css" id="theme">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'files/reveal.js/css/print/pdf.css' : 'files/reveal.js/css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="files/reveal.js/lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<div class="slides">
<section id="title-slide">
<h1 class="title">Outils de corpus – 4</h1>
<p class="subtitle">M1 Plurital</p>
<p class="author">[email protected]</p>
</section>
<section id="extraction-dinformation" class="slide level3">
<h3>Extraction d’information</h3>
<blockquote>
<p>Cyclone Idai, the storm that has killed hundreds of people, submerged homes and battered cities in southeastern Africa, may prove to be one of the worst weather-related disasters ever in the Southern Hemisphere, a United Nations official said on Tuesday.</p>
</blockquote>
<p><a href="https://www.nytimes.com/2019/03/19/world/africa/cyclone-idai-mozambique.html">NYTimes 19/03/2019</a></p>
</section>
<section id="extraction-dinformation-1" class="slide level3">
<h3>Extraction d’information</h3>
<ul>
<li>Analyse de <a href="https://natural-language-understanding-demo.ng.bluemix.net/">watson</a>:
<ul>
<li>subject: <em>Cyclon Idai, the storm</em></li>
<li>action: <em>that has killed</em></li>
<li>object: <em>hundred of people</em></li>
</ul></li>
</ul>
</section>
<section id="extraction-dinformation-2" class="slide level3">
<h3>Extraction d’information</h3>
<p>Comment faire pour extraire ce type d’information ?</p>
<ul>
<li>Identification des groupes et des fonctions syntaxiques -> parseurs syntaxiques</li>
<li>Extraction des infos (sujet, prédicat, objet)
<ul>
<li>langage de requête</li>
<li>script <em>adhoc</em></li>
</ul></li>
</ul>
</section>
<section id="exploiter-les-annotations-en-dépendance" class="slide level3">
<h3>Exploiter les annotations en dépendance</h3>
<table>
<thead>
<tr class="header">
<th>linguiste</th>
<th>fichier</th>
<th style="text-align: center;">repr. informatique</th>
<th style="text-align: center;">implémentation</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>schéma</td>
<td><code>.conll</code></td>
<td style="text-align: center;">?</td>
<td style="text-align: center;">?</td>
</tr>
</tbody>
</table>
</section>
<section id="exploiter-les-annotations-en-dépendance-1" class="slide level3">
<h3>Exploiter les annotations en dépendance</h3>
<figure>
<img data-src="files/sequoia-spacy.svg" alt="voir sur grew-match" /><figcaption><a href="http://match.grew.fr/[email protected]&custom=5ca0de55a3daa">voir sur grew-match</a></figcaption>
</figure>
</section>
<section id="exploiter-les-annotations-en-dépendance-2" class="slide level3">
<h3>Exploiter les annotations en dépendance</h3>
<p><a href="http://universaldependencies.org/format.html">CoNLL-U Format</a></p>
<pre><code># sent_id = annodis.er_00461
# text = Le conseil municipal donne son accord pour cette procédure.
1 Le le DET _ Definite=Def|Gender=Masc|Number=Sing|PronType=Art 2 det _ _
2 conseil conseil NOUN _ Gender=Masc|Number=Sing 4 nsubj _ _
3 municipal municipal ADJ _ Gender=Masc|Number=Sing 2 amod _ _
4 donne donner VERB _ Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin 0 root _ _
5 son son DET _ Number=Sing|Poss=Yes 6 det _ _
6 accord accord NOUN _ Gender=Masc|Number=Sing 4 obj _ _
7 pour pour ADP _ _ 9 case _ _
8 cette ce DET _ Gender=Fem|Number=Sing|PronType=Dem 9 det _ _
9 procédure procédure NOUN _ Gender=Fem|Number=Sing 4 obl:mod _ SpaceAfter=No
10 . . PUNCT _ _ 4 punct _ _</code></pre>
</section>
<section id="exploiter-les-annotations-en-dépendance-3" class="slide level3">
<h3>Exploiter les annotations en dépendance</h3>
<table>
<thead>
<tr class="header">
<th>linguiste</th>
<th>fichier</th>
<th style="text-align: center;">repr. informatique</th>
<th style="text-align: center;">implémentation</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>schéma</td>
<td><code>.conll</code></td>
<td style="text-align: center;">graphe</td>
<td style="text-align: center;">?</td>
</tr>
</tbody>
</table>
</section>
<section id="graphe" class="slide level3">
<h3>Graphe</h3>
<ul>
<li>Les arbres de dépendance sont le plus souvent représentés par des graphes</li>
<li>Les graphes sont des modèles abstraits de réseaux : ensemble de <em>sommets</em> (ou nœuds) et de relations entre les sommets appelées <em>arêtes</em></li>
<li>La théorie des graphes trouve son origine dans le <a href="https://fr.wikipedia.org/wiki/Probl%C3%A8me_des_sept_ponts_de_K%C3%B6nigsberg">problème des sept ponts de Königsberg</a></li>
<li>À la frontière entre les mathématiques et l’informatique, les graphes sont très utilisés (plans de métros, maillage d’utilisateurs sur un réseau social, réseau électrique, …)</li>
</ul>
</section>
<section id="graphe-1" class="slide level3">
<h3>Graphe</h3>
<p><img data-src="files/graphe.png" /></p>
<ul>
<li>des sommets (ou nœuds)</li>
<li>des arêtes</li>
</ul>
</section>
<section id="graphe-dirigé" class="slide level3">
<h3>Graphe dirigé</h3>
<p><img data-src="files/graphe-dirige.png" /></p>
</section>
<section id="graphe-pondéré" class="slide level3">
<h3>Graphe pondéré</h3>
<p><img data-src="files/graphe-pondere.png" /></p>
</section>
<section id="plus-court-chemin" class="slide level3">
<h3>Plus court chemin</h3>
<ul>
<li>Le « problème du plus court chemin » est un grand classique de l’algorithmique (voir <a href="https://fr.wikipedia.org/wiki/Algorithme_de_Dijkstra">algorithme de Dijkstra</a>)</li>
<li>Il est à l’œuvre dans beaucoup d’applications avec géolocalisation ou pour le routage par exemple</li>
</ul>
</section>
<section id="plus-court-chemin-1" class="slide level3">
<h3>Plus court chemin</h3>
<p><img data-src="files/graphe-dirige-court.png" alt="Graphe dirigé" /> <img data-src="files/graphe-pondere-court.png" alt="Graphe pondéré" /></p>
</section>
<section id="exploiter-les-annotations-en-dépendance-4" class="slide level3">
<h3>Exploiter les annotations en dépendance</h3>
<table>
<thead>
<tr class="header">
<th>linguiste</th>
<th>fichier</th>
<th style="text-align: center;">repr. informatique</th>
<th style="text-align: center;">implémentation</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>schéma</td>
<td><code>.conll</code></td>
<td style="text-align: center;">graphe</td>
<td style="text-align: center;"><code>dict</code></td>
</tr>
</tbody>
</table>
</section>
<section class="slide level3">
<h4 id="graphe-implémentation-en-python">Graphe : implémentation en Python</h4>
<p><img data-src="files/graphe.png" /></p>
<p>Travail sur le notebook : <a href="outils_corpus-4.ipynb">outils_corpus-4.ipynb</a></p>
<div class="sourceCode" id="cb2"><pre class="sourceCode python"><code class="sourceCode python"><a class="sourceLine" id="cb2-1" data-line-number="1">graph <span class="op">=</span> {</a>
<a class="sourceLine" id="cb2-2" data-line-number="2"> <span class="st">'A'</span>: [<span class="st">'B'</span>, <span class="st">'C'</span>, <span class="st">'E'</span>],</a>
<a class="sourceLine" id="cb2-3" data-line-number="3"> <span class="st">'B'</span>: [<span class="st">'F'</span>],</a>
<a class="sourceLine" id="cb2-4" data-line-number="4"> <span class="st">'F'</span>:[<span class="st">'I'</span>],</a>
<a class="sourceLine" id="cb2-5" data-line-number="5"> <span class="st">'I'</span>:[<span class="st">'J'</span>],</a>
<a class="sourceLine" id="cb2-6" data-line-number="6"> <span class="st">'C'</span>:[<span class="st">'G'</span>,<span class="st">'H'</span>],</a>
<a class="sourceLine" id="cb2-7" data-line-number="7"> <span class="st">'H'</span>:[<span class="st">'D'</span>,<span class="st">'J'</span>]</a>
<a class="sourceLine" id="cb2-8" data-line-number="8"> }</a></code></pre></div>
</section>
</div>
</div>
<script src="files/reveal.js/lib/js/head.min.js"></script>
<script src="files/reveal.js/js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
// Display controls in the bottom right corner
controls: false,
// Push each slide change to the browser history
history: true,
// Vertical centering of slides
center: false,
maxScale: 1.2,
math: {
mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js',
config: 'TeX-AMS_HTML-full',
tex2jax: {
inlineMath: [['\\(','\\)']],
displayMath: [['\\[','\\]']],
balanceBraces: true,
processEscapes: false,
processRefs: true,
processEnvironments: true,
preview: 'TeX',
skipTags: ['script','noscript','style','textarea','pre','code'],
ignoreClass: 'tex2jax_ignore',
processClass: 'tex2jax_process'
},
},
// Optional reveal.js plugins
dependencies: [
{ src: 'files/reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'files/reveal.js/plugin/zoom-js/zoom.js', async: true },
{ src: 'files/reveal.js/plugin/math/math.js', async: true },
{ src: 'files/reveal.js/plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>