Hello,
It happens when i copy paste text from wikipedia in a text file (notpad++ for example) using doc.ents with spacy.
If i put text in variable like this :
var = "texte here, …
… other sentence "
spacy is working well.
But same text in a text file with sentence = open(test_text, “r”).read()
give me some differents results with doc.ents (very close but a little bit different and comma are detected like LOC / ORG / MISC, etc …)
example from text file :
Mot :
, Entity : ORG
Mot :
, Entity : LOC
Mot : GBR, Entity : MISC
Mot :
, Entity : MISC
Mot :
, Entity : ORG
Mot : 3D de bâtiments, Entity : MISC
Mot : Antiquité, Entity : MISC
Mot : Rome antique, Entity : LOC
Mot :
, Entity : LOC
Mot :
, Entity : LOC
Mot : Cyclades, Entity : MISC
Mot : Péloponnèse, Entity : LOC
Mot :
, Entity : LOC
Mot : Pausanias, Entity : PER
Mot : Byzès de Naxos, Entity : PER
Mot : pin de Macédoine, Entity : LOC
Mot : Péloponnèse, Entity : LOC
Mot : Sicyone, Entity : LOC
Mot : Égypte, Entity : LOC
Mot :
, Entity : LOC
Mot :
, Entity : ORG
Mot :
, Entity : ORG
Mot : Périclès, Entity : PER
Mot : Plutarque, Entity : PER
Mot : France, Entity : LOC
Mot : Encyclopédique de Roret, Entity : LOC
Mot : tuile de, Entity : LOC
Mot : tuile d’Altkirch, Entity : LOC
Mot :
same text in variable :
Mot : GBR, Entity : MISC
Mot : Antiquité, Entity : MISC
Mot : Rome antique, Entity : LOC
Mot : Cyclades, Entity : MISC
Mot : Péloponnèse, Entity : LOC
Mot : Pausanias, Entity : PER
Mot : Byzès, Entity : PER
Mot : Naxos, Entity : LOC
Mot : Macédoine, Entity : LOC
Mot : Péloponnèse, Entity : LOC
Mot : Sicyone, Entity : LOC
Mot : Égypte, Entity : LOC
Mot : Périclès, Entity : PER
Mot : Plutarque, Entity : PER
Mot : France, Entity : LOC
Mot : Encyclopédique de Roret, Entity : LOC
Mot : tuile de, Entity : LOC
Mot : tuile d’Altkirch, Entity : LOC
maybe open.read() method is not a best practice.