Upload test.py
Browse files
test.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import spacy
|
2 |
+
|
3 |
+
nlp = spacy.load('en_core_web_lg')
|
4 |
+
|
5 |
+
doc = nlp(u"Harry Potter star Daniel Radcliffe gets £20M fortune as he turns 18 Monday . Young actor says he has no plans to fritter his cash away . Radcliffe's earnings from first five Potter films have been held in trust fund .")
|
6 |
+
for entity in doc.ents:
|
7 |
+
print(entity.label_, ' | ', entity.text)
|
8 |
+
|
9 |
+
doc = nlp(u"Mentally ill inmates in Miami are housed on the 'forgotten floor' Judge Steven Leifman says most are there as a result of 'avoidable felonies' While CNN tours facility, patient shouts: 'I am the son of the president' Leifman says the system is unjust and he's fighting for change .")
|
10 |
+
for entity in doc.ents:
|
11 |
+
print(entity.label_, ' | ', entity.text)
|