doc : dp
This commit is contained in:
parent
12fbc34110
commit
acfd8f7958
5 changed files with 419 additions and 91 deletions
|
|
@ -121,3 +121,9 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@unpublished{spacy2,
|
||||||
|
AUTHOR = {Honnibal, Matthew and Montani, Ines},
|
||||||
|
TITLE = {{spaCy 2}: Natural language understanding with {B}loom embeddings, convolutional neural networks and incremental parsing},
|
||||||
|
YEAR = {2017},
|
||||||
|
Note = {spaCy excels at large-scale information extraction tasks.}
|
||||||
|
}
|
||||||
|
|
@ -25,12 +25,13 @@ In linguistics and \acs{nlp}, corpus refers to a collection of texts. This paper
|
||||||
|
|
||||||
Wikipedia\footnote{https://www.wikipedia.org/} is primarily an encyclopedia with the additional benefit of heavy linking between articles and without the size constraints of paper articles \cite{TorstenZesch}. Wikipedia API \footnote{https://pypi.org/project/Wikipedia-API/}
|
Wikipedia\footnote{https://www.wikipedia.org/} is primarily an encyclopedia with the additional benefit of heavy linking between articles and without the size constraints of paper articles \cite{TorstenZesch}. Wikipedia API \footnote{https://pypi.org/project/Wikipedia-API/}
|
||||||
|
|
||||||
|
\section{spaCy - Dependency Parsing}
|
||||||
|
|
||||||
|
spaCy\cite{spacy2} features neural models for parsing and entity recognition. These models can be trained for \acf{ner} , tagging and parsing. Its official page on usage\footnote {https://v2.spacy.io/usage/} provides in-depth code example for information extraction.
|
||||||
|
|
||||||
|
\begin{figure}[htp!]
|
||||||
\begin{figure}[h!]
|
|
||||||
\centering
|
\centering
|
||||||
\includesvg{pronoun.svg}
|
\includesvg[scale=0.16]{dependency-parser.svg}
|
||||||
\caption{kuch kar bhai}
|
\caption{kuch kar bhai}
|
||||||
\label{fig:propn}
|
\label{fig:propn}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
|
||||||
266
doc/images/dependency-parser.svg
Normal file
266
doc/images/dependency-parser.svg
Normal file
|
|
@ -0,0 +1,266 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" id="c7869c4b1d334607a4f3a74b7b707922-0" class="displacy" width="3725" height="399.5" direction="ltr" style="max-width: none; height: 399.5px; color: #000000; background: #ffffff; font-family: Arial; direction: ltr">
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="50">Motor</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="50">NOUN</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="225">oil,</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="225">NOUN</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="400">engine</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="400">NOUN</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="575">oil,</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="575">NOUN</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="750">or</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="750">CCONJ</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="925">engine</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="925">NOUN</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="1100">lubricant</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="1100">NOUN</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="1275">is</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="1275">AUX</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="1450">any</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="1450">DET</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="1625">one</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="1625">NUM</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="1800">of</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="1800">ADP</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="1975">various</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="1975">ADJ</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="2150">substances</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="2150">NOUN</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="2325">used</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="2325">VERB</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="2500">for</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="2500">ADP</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="2675">the</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="2675">DET</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="2850">lubrication</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="2850">NOUN</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="3025">of</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="3025">ADP</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="3200">internal</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="3200">ADJ</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="3375">combustion</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="3375">NOUN</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<text class="displacy-token" fill="currentColor" text-anchor="middle" y="309.5">
|
||||||
|
<tspan class="displacy-word" fill="currentColor" x="3550">engines</tspan>
|
||||||
|
<tspan class="displacy-tag" dy="2em" fill="currentColor" x="3550">NOUN</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-0" stroke-width="2px" d="M70,264.5 C70,177.0 215.0,177.0 215.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-0" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">compound</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M70,266.5 L62,254.5 78,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-1" stroke-width="2px" d="M245,264.5 C245,2.0 1275.0,2.0 1275.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-1" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">nsubj</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M245,266.5 L237,254.5 253,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-2" stroke-width="2px" d="M420,264.5 C420,177.0 565.0,177.0 565.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-2" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">compound</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M420,266.5 L412,254.5 428,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-3" stroke-width="2px" d="M245,264.5 C245,89.5 570.0,89.5 570.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-3" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">conj</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M570.0,266.5 L578.0,254.5 562.0,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-4" stroke-width="2px" d="M595,264.5 C595,177.0 740.0,177.0 740.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-4" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">cc</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M740.0,266.5 L748.0,254.5 732.0,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-5" stroke-width="2px" d="M945,264.5 C945,177.0 1090.0,177.0 1090.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-5" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">compound</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M945,266.5 L937,254.5 953,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-6" stroke-width="2px" d="M595,264.5 C595,89.5 1095.0,89.5 1095.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-6" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">conj</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M1095.0,266.5 L1103.0,254.5 1087.0,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-7" stroke-width="2px" d="M1470,264.5 C1470,177.0 1615.0,177.0 1615.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-7" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">det</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M1470,266.5 L1462,254.5 1478,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-8" stroke-width="2px" d="M1295,264.5 C1295,89.5 1620.0,89.5 1620.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-8" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">attr</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M1620.0,266.5 L1628.0,254.5 1612.0,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-9" stroke-width="2px" d="M1645,264.5 C1645,177.0 1790.0,177.0 1790.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-9" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">prep</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M1790.0,266.5 L1798.0,254.5 1782.0,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-10" stroke-width="2px" d="M1995,264.5 C1995,177.0 2140.0,177.0 2140.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-10" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">amod</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M1995,266.5 L1987,254.5 2003,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-11" stroke-width="2px" d="M1820,264.5 C1820,89.5 2145.0,89.5 2145.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-11" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">pobj</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M2145.0,266.5 L2153.0,254.5 2137.0,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-12" stroke-width="2px" d="M2170,264.5 C2170,177.0 2315.0,177.0 2315.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-12" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">acl</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M2315.0,266.5 L2323.0,254.5 2307.0,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-13" stroke-width="2px" d="M2345,264.5 C2345,177.0 2490.0,177.0 2490.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-13" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">prep</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M2490.0,266.5 L2498.0,254.5 2482.0,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-14" stroke-width="2px" d="M2695,264.5 C2695,177.0 2840.0,177.0 2840.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-14" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">det</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M2695,266.5 L2687,254.5 2703,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-15" stroke-width="2px" d="M2520,264.5 C2520,89.5 2845.0,89.5 2845.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-15" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">pobj</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M2845.0,266.5 L2853.0,254.5 2837.0,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-16" stroke-width="2px" d="M2870,264.5 C2870,177.0 3015.0,177.0 3015.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-16" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">prep</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M3015.0,266.5 L3023.0,254.5 3007.0,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-17" stroke-width="2px" d="M3220,264.5 C3220,177.0 3365.0,177.0 3365.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-17" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">amod</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M3220,266.5 L3212,254.5 3228,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-18" stroke-width="2px" d="M3395,264.5 C3395,177.0 3540.0,177.0 3540.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-18" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">compound</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M3395,266.5 L3387,254.5 3403,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="displacy-arrow">
|
||||||
|
<path class="displacy-arc" id="arrow-c7869c4b1d334607a4f3a74b7b707922-0-19" stroke-width="2px" d="M3045,264.5 C3045,89.5 3545.0,89.5 3545.0,264.5" fill="none" stroke="currentColor"/>
|
||||||
|
<text dy="1.25em" style="font-size: 0.8em; letter-spacing: 1px">
|
||||||
|
<textPath xlink:href="#arrow-c7869c4b1d334607a4f3a74b7b707922-0-19" class="displacy-label" startOffset="50%" side="left" fill="currentColor" text-anchor="middle">pobj</textPath>
|
||||||
|
</text>
|
||||||
|
<path class="displacy-arrowhead" d="M3545.0,266.5 L3553.0,254.5 3537.0,254.5" fill="currentColor"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 17 KiB |
|
|
@ -13,5 +13,7 @@
|
||||||
|
|
||||||
\acro{qg}[QG]{Question generation}
|
\acro{qg}[QG]{Question generation}
|
||||||
|
|
||||||
|
\acro{ner}[NER]{Named Entity Recognition}
|
||||||
|
|
||||||
\end{acronym}
|
\end{acronym}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,53 +1,5 @@
|
||||||
{
|
{
|
||||||
"cells": [
|
"cells": [
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 1,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"Requirement already satisfied: spacy in /home/shoney/dev/.venv/lib/python3.9/site-packages (3.5.3)\n",
|
|
||||||
"Requirement already satisfied: typer<0.8.0,>=0.3.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (0.7.0)\n",
|
|
||||||
"Requirement already satisfied: jinja2 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (3.1.2)\n",
|
|
||||||
"Requirement already satisfied: setuptools in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (57.4.0)\n",
|
|
||||||
"Requirement already satisfied: numpy>=1.15.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (1.24.3)\n",
|
|
||||||
"Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.11 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (3.0.12)\n",
|
|
||||||
"Requirement already satisfied: packaging>=20.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (23.1)\n",
|
|
||||||
"Requirement already satisfied: requests<3.0.0,>=2.13.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (2.31.0)\n",
|
|
||||||
"Requirement already satisfied: pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (1.10.8)\n",
|
|
||||||
"Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (4.65.0)\n",
|
|
||||||
"Requirement already satisfied: thinc<8.2.0,>=8.1.8 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (8.1.10)\n",
|
|
||||||
"Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (1.0.4)\n",
|
|
||||||
"Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (1.0.9)\n",
|
|
||||||
"Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (3.0.8)\n",
|
|
||||||
"Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (2.0.8)\n",
|
|
||||||
"Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (3.3.0)\n",
|
|
||||||
"Requirement already satisfied: pathy>=0.10.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (0.10.1)\n",
|
|
||||||
"Requirement already satisfied: wasabi<1.2.0,>=0.9.1 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (1.1.1)\n",
|
|
||||||
"Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (2.0.7)\n",
|
|
||||||
"Requirement already satisfied: smart-open<7.0.0,>=5.2.1 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (6.3.0)\n",
|
|
||||||
"Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy) (2.4.6)\n",
|
|
||||||
"Requirement already satisfied: typing-extensions>=4.2.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4->spacy) (4.6.1)\n",
|
|
||||||
"Requirement already satisfied: idna<4,>=2.5 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from requests<3.0.0,>=2.13.0->spacy) (3.4)\n",
|
|
||||||
"Requirement already satisfied: urllib3<3,>=1.21.1 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from requests<3.0.0,>=2.13.0->spacy) (2.0.2)\n",
|
|
||||||
"Requirement already satisfied: charset-normalizer<4,>=2 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from requests<3.0.0,>=2.13.0->spacy) (3.1.0)\n",
|
|
||||||
"Requirement already satisfied: certifi>=2017.4.17 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from requests<3.0.0,>=2.13.0->spacy) (2023.5.7)\n",
|
|
||||||
"Requirement already satisfied: blis<0.8.0,>=0.7.8 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from thinc<8.2.0,>=8.1.8->spacy) (0.7.9)\n",
|
|
||||||
"Requirement already satisfied: confection<1.0.0,>=0.0.1 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from thinc<8.2.0,>=8.1.8->spacy) (0.0.4)\n",
|
|
||||||
"Requirement already satisfied: click<9.0.0,>=7.1.1 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from typer<0.8.0,>=0.3.0->spacy) (8.1.3)\n",
|
|
||||||
"Requirement already satisfied: MarkupSafe>=2.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from jinja2->spacy) (2.1.2)\n",
|
|
||||||
"\u001b[33mWARNING: You are using pip version 21.2.3; however, version 23.1.2 is available.\n",
|
|
||||||
"You should consider upgrading via the '/home/shoney/dev/.venv/bin/python -m pip install --upgrade pip' command.\u001b[0m\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
|
||||||
"!python -m pip install spacy"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 2,
|
"execution_count": 2,
|
||||||
|
|
@ -57,53 +9,138 @@
|
||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
|
"Defaulting to user installation because normal site-packages is not writeable\n",
|
||||||
|
"Collecting spacy\n",
|
||||||
|
" Downloading spacy-3.5.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m6.6/6.6 MB\u001b[0m \u001b[31m5.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
||||||
|
"\u001b[?25hCollecting pathy>=0.10.0\n",
|
||||||
|
" Downloading pathy-0.10.1-py3-none-any.whl (48 kB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m48.9/48.9 KB\u001b[0m \u001b[31m5.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
||||||
|
"\u001b[?25hCollecting preshed<3.1.0,>=3.0.2\n",
|
||||||
|
" Downloading preshed-3.0.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (124 kB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m124.7/124.7 KB\u001b[0m \u001b[31m5.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
||||||
|
"\u001b[?25hCollecting cymem<2.1.0,>=2.0.2\n",
|
||||||
|
" Downloading cymem-2.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34 kB)\n",
|
||||||
|
"Collecting tqdm<5.0.0,>=4.38.0\n",
|
||||||
|
" Downloading tqdm-4.65.0-py3-none-any.whl (77 kB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m77.1/77.1 KB\u001b[0m \u001b[31m7.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
||||||
|
"\u001b[?25hCollecting spacy-loggers<2.0.0,>=1.0.0\n",
|
||||||
|
" Downloading spacy_loggers-1.0.4-py3-none-any.whl (11 kB)\n",
|
||||||
|
"Requirement already satisfied: jinja2 in /home/shoney/.local/lib/python3.10/site-packages (from spacy) (3.1.2)\n",
|
||||||
|
"Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from spacy) (59.6.0)\n",
|
||||||
|
"Collecting catalogue<2.1.0,>=2.0.6\n",
|
||||||
|
" Downloading catalogue-2.0.8-py3-none-any.whl (17 kB)\n",
|
||||||
|
"Requirement already satisfied: numpy>=1.15.0 in /home/shoney/.local/lib/python3.10/site-packages (from spacy) (1.24.3)\n",
|
||||||
|
"Collecting murmurhash<1.1.0,>=0.28.0\n",
|
||||||
|
" Downloading murmurhash-1.0.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21 kB)\n",
|
||||||
|
"Collecting spacy-legacy<3.1.0,>=3.0.11\n",
|
||||||
|
" Downloading spacy_legacy-3.0.12-py2.py3-none-any.whl (29 kB)\n",
|
||||||
|
"Collecting requests<3.0.0,>=2.13.0\n",
|
||||||
|
" Downloading requests-2.31.0-py3-none-any.whl (62 kB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.6/62.6 KB\u001b[0m \u001b[31m12.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
||||||
|
"\u001b[?25hCollecting typer<0.8.0,>=0.3.0\n",
|
||||||
|
" Downloading typer-0.7.0-py3-none-any.whl (38 kB)\n",
|
||||||
|
"Requirement already satisfied: packaging>=20.0 in /home/shoney/.local/lib/python3.10/site-packages (from spacy) (23.1)\n",
|
||||||
|
"Collecting langcodes<4.0.0,>=3.2.0\n",
|
||||||
|
" Downloading langcodes-3.3.0-py3-none-any.whl (181 kB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m181.6/181.6 KB\u001b[0m \u001b[31m7.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
||||||
|
"\u001b[?25hCollecting srsly<3.0.0,>=2.4.3\n",
|
||||||
|
" Downloading srsly-2.4.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (492 kB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m492.2/492.2 KB\u001b[0m \u001b[31m6.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
||||||
|
"\u001b[?25hCollecting smart-open<7.0.0,>=5.2.1\n",
|
||||||
|
" Downloading smart_open-6.3.0-py3-none-any.whl (56 kB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m56.8/56.8 KB\u001b[0m \u001b[31m8.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
||||||
|
"\u001b[?25hCollecting thinc<8.2.0,>=8.1.8\n",
|
||||||
|
" Downloading thinc-8.1.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (913 kB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m913.3/913.3 KB\u001b[0m \u001b[31m6.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
||||||
|
"\u001b[?25hCollecting wasabi<1.2.0,>=0.9.1\n",
|
||||||
|
" Downloading wasabi-1.1.2-py3-none-any.whl (27 kB)\n",
|
||||||
|
"Collecting pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4\n",
|
||||||
|
" Downloading pydantic-1.10.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.1/3.1 MB\u001b[0m \u001b[31m4.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
||||||
|
"\u001b[?25hCollecting typing-extensions>=4.2.0\n",
|
||||||
|
" Downloading typing_extensions-4.6.3-py3-none-any.whl (31 kB)\n",
|
||||||
|
"Requirement already satisfied: idna<4,>=2.5 in /home/shoney/.local/lib/python3.10/site-packages (from requests<3.0.0,>=2.13.0->spacy) (3.4)\n",
|
||||||
|
"Requirement already satisfied: urllib3<3,>=1.21.1 in /home/shoney/.local/lib/python3.10/site-packages (from requests<3.0.0,>=2.13.0->spacy) (1.26.16)\n",
|
||||||
|
"Requirement already satisfied: certifi>=2017.4.17 in /home/shoney/.local/lib/python3.10/site-packages (from requests<3.0.0,>=2.13.0->spacy) (2023.5.7)\n",
|
||||||
|
"Collecting charset-normalizer<4,>=2\n",
|
||||||
|
" Downloading charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (199 kB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m199.3/199.3 KB\u001b[0m \u001b[31m5.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
||||||
|
"\u001b[?25hCollecting confection<1.0.0,>=0.0.1\n",
|
||||||
|
" Downloading confection-0.0.4-py3-none-any.whl (32 kB)\n",
|
||||||
|
"Collecting blis<0.8.0,>=0.7.8\n",
|
||||||
|
" Downloading blis-0.7.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.2 MB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m10.2/10.2 MB\u001b[0m \u001b[31m5.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m0:01\u001b[0m\n",
|
||||||
|
"\u001b[?25hCollecting click<9.0.0,>=7.1.1\n",
|
||||||
|
" Downloading click-8.1.3-py3-none-any.whl (96 kB)\n",
|
||||||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m96.6/96.6 KB\u001b[0m \u001b[31m4.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
||||||
|
"\u001b[?25hRequirement already satisfied: MarkupSafe>=2.0 in /home/shoney/.local/lib/python3.10/site-packages (from jinja2->spacy) (2.1.3)\n",
|
||||||
|
"Installing collected packages: cymem, wasabi, typing-extensions, tqdm, spacy-loggers, spacy-legacy, smart-open, murmurhash, langcodes, click, charset-normalizer, catalogue, blis, typer, srsly, requests, pydantic, preshed, pathy, confection, thinc, spacy\n",
|
||||||
|
"Successfully installed blis-0.7.9 catalogue-2.0.8 charset-normalizer-3.1.0 click-8.1.3 confection-0.0.4 cymem-2.0.7 langcodes-3.3.0 murmurhash-1.0.9 pathy-0.10.1 preshed-3.0.8 pydantic-1.10.9 requests-2.31.0 smart-open-6.3.0 spacy-3.5.3 spacy-legacy-3.0.12 spacy-loggers-1.0.4 srsly-2.4.6 thinc-8.1.10 tqdm-4.65.0 typer-0.7.0 typing-extensions-4.6.3 wasabi-1.1.2\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"!python3 -m pip install spacy"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 3,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Defaulting to user installation because normal site-packages is not writeable\n",
|
||||||
"Collecting en-core-web-sm==3.5.0\n",
|
"Collecting en-core-web-sm==3.5.0\n",
|
||||||
" Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.5.0/en_core_web_sm-3.5.0-py3-none-any.whl (12.8 MB)\n",
|
" Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.5.0/en_core_web_sm-3.5.0-py3-none-any.whl (12.8 MB)\n",
|
||||||
"\u001b[K |████████████████████████████████| 12.8 MB 625 kB/s eta 0:00:01\n",
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.8/12.8 MB\u001b[0m \u001b[31m4.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
||||||
"\u001b[?25hRequirement already satisfied: spacy<3.6.0,>=3.5.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from en-core-web-sm==3.5.0) (3.5.3)\n",
|
"\u001b[?25hRequirement already satisfied: spacy<3.6.0,>=3.5.0 in /home/shoney/.local/lib/python3.10/site-packages (from en-core-web-sm==3.5.0) (3.5.3)\n",
|
||||||
"Requirement already satisfied: numpy>=1.15.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (1.24.3)\n",
|
"Requirement already satisfied: pathy>=0.10.0 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (0.10.1)\n",
|
||||||
"Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (3.0.8)\n",
|
"Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2.0.8)\n",
|
||||||
"Requirement already satisfied: packaging>=20.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (23.1)\n",
|
"Requirement already satisfied: thinc<8.2.0,>=8.1.8 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (8.1.10)\n",
|
||||||
"Requirement already satisfied: pathy>=0.10.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (0.10.1)\n",
|
"Requirement already satisfied: wasabi<1.2.0,>=0.9.1 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (1.1.2)\n",
|
||||||
"Requirement already satisfied: smart-open<7.0.0,>=5.2.1 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (6.3.0)\n",
|
"Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (3.3.0)\n",
|
||||||
"Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (1.0.4)\n",
|
"Requirement already satisfied: packaging>=20.0 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (23.1)\n",
|
||||||
"Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.11 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (3.0.12)\n",
|
"Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (3.0.8)\n",
|
||||||
"Requirement already satisfied: typer<0.8.0,>=0.3.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (0.7.0)\n",
|
"Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (4.65.0)\n",
|
||||||
"Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2.4.6)\n",
|
"Requirement already satisfied: jinja2 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (3.1.2)\n",
|
||||||
"Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (3.3.0)\n",
|
"Requirement already satisfied: pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (1.10.9)\n",
|
||||||
"Requirement already satisfied: requests<3.0.0,>=2.13.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2.31.0)\n",
|
"Requirement already satisfied: numpy>=1.15.0 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (1.24.3)\n",
|
||||||
"Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2.0.8)\n",
|
"Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (59.6.0)\n",
|
||||||
"Requirement already satisfied: setuptools in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (57.4.0)\n",
|
"Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (1.0.4)\n",
|
||||||
"Requirement already satisfied: pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (1.10.8)\n",
|
"Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.11 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (3.0.12)\n",
|
||||||
"Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (1.0.9)\n",
|
"Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2.0.7)\n",
|
||||||
"Requirement already satisfied: jinja2 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (3.1.2)\n",
|
"Requirement already satisfied: smart-open<7.0.0,>=5.2.1 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (6.3.0)\n",
|
||||||
"Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2.0.7)\n",
|
"Requirement already satisfied: requests<3.0.0,>=2.13.0 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2.31.0)\n",
|
||||||
"Requirement already satisfied: thinc<8.2.0,>=8.1.8 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (8.1.10)\n",
|
"Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (1.0.9)\n",
|
||||||
"Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (4.65.0)\n",
|
"Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2.4.6)\n",
|
||||||
"Requirement already satisfied: wasabi<1.2.0,>=0.9.1 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (1.1.1)\n",
|
"Requirement already satisfied: typer<0.8.0,>=0.3.0 in /home/shoney/.local/lib/python3.10/site-packages (from spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (0.7.0)\n",
|
||||||
"Requirement already satisfied: typing-extensions>=4.2.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (4.6.1)\n",
|
"Requirement already satisfied: typing-extensions>=4.2.0 in /home/shoney/.local/lib/python3.10/site-packages (from pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (4.6.3)\n",
|
||||||
"Requirement already satisfied: certifi>=2017.4.17 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2023.5.7)\n",
|
"Requirement already satisfied: idna<4,>=2.5 in /home/shoney/.local/lib/python3.10/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (3.4)\n",
|
||||||
"Requirement already satisfied: charset-normalizer<4,>=2 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (3.1.0)\n",
|
"Requirement already satisfied: certifi>=2017.4.17 in /home/shoney/.local/lib/python3.10/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2023.5.7)\n",
|
||||||
"Requirement already satisfied: urllib3<3,>=1.21.1 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2.0.2)\n",
|
"Requirement already satisfied: charset-normalizer<4,>=2 in /home/shoney/.local/lib/python3.10/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (3.1.0)\n",
|
||||||
"Requirement already satisfied: idna<4,>=2.5 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (3.4)\n",
|
"Requirement already satisfied: urllib3<3,>=1.21.1 in /home/shoney/.local/lib/python3.10/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (1.26.16)\n",
|
||||||
"Requirement already satisfied: blis<0.8.0,>=0.7.8 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from thinc<8.2.0,>=8.1.8->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (0.7.9)\n",
|
"Requirement already satisfied: blis<0.8.0,>=0.7.8 in /home/shoney/.local/lib/python3.10/site-packages (from thinc<8.2.0,>=8.1.8->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (0.7.9)\n",
|
||||||
"Requirement already satisfied: confection<1.0.0,>=0.0.1 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from thinc<8.2.0,>=8.1.8->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (0.0.4)\n",
|
"Requirement already satisfied: confection<1.0.0,>=0.0.1 in /home/shoney/.local/lib/python3.10/site-packages (from thinc<8.2.0,>=8.1.8->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (0.0.4)\n",
|
||||||
"Requirement already satisfied: click<9.0.0,>=7.1.1 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from typer<0.8.0,>=0.3.0->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (8.1.3)\n",
|
"Requirement already satisfied: click<9.0.0,>=7.1.1 in /home/shoney/.local/lib/python3.10/site-packages (from typer<0.8.0,>=0.3.0->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (8.1.3)\n",
|
||||||
"Requirement already satisfied: MarkupSafe>=2.0 in /home/shoney/dev/.venv/lib/python3.9/site-packages (from jinja2->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2.1.2)\n",
|
"Requirement already satisfied: MarkupSafe>=2.0 in /home/shoney/.local/lib/python3.10/site-packages (from jinja2->spacy<3.6.0,>=3.5.0->en-core-web-sm==3.5.0) (2.1.3)\n",
|
||||||
"\u001b[33mWARNING: You are using pip version 21.2.3; however, version 23.1.2 is available.\n",
|
"Installing collected packages: en-core-web-sm\n",
|
||||||
"You should consider upgrading via the '/home/shoney/dev/.venv/bin/python -m pip install --upgrade pip' command.\u001b[0m\n",
|
"Successfully installed en-core-web-sm-3.5.0\n",
|
||||||
"\u001b[38;5;2m✔ Download and installation successful\u001b[0m\n",
|
"\u001b[38;5;2m✔ Download and installation successful\u001b[0m\n",
|
||||||
"You can now load the package via spacy.load('en_core_web_sm')\n"
|
"You can now load the package via spacy.load('en_core_web_sm')\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"!python -m spacy download en_core_web_sm"
|
"!python3 -m spacy download en_core_web_sm"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 7,
|
"execution_count": 4,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
|
|
@ -118,11 +155,27 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 4,
|
"execution_count": 6,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": [
|
||||||
|
"17268"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 6,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"text = (\"Motor oil, engine oil, or engine lubricant is any one of various substances used for the lubrication of internal combustion engines\")"
|
"text = (\"Motor oil, engine oil, or engine lubricant is any one of various substances used for the lubrication of internal combustion engines\")\n",
|
||||||
|
"doc = nlp(text)\n",
|
||||||
|
"svg = displacy.render(doc, style=\"dep\",jupyter=False)\n",
|
||||||
|
"\n",
|
||||||
|
"output_path = Path(\"../doc/images/dependency-parser.svg\") # you can keep there only \"dependency_plot.svg\" if you want to save it in the same folder where you run the script \n",
|
||||||
|
"output_path.open(\"w\", encoding=\"utf-8\").write(svg)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -733,7 +786,7 @@
|
||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.9.7"
|
"version": "3.10.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue