Problems in detecting Spanish Date with es-core-news-lg v3.8.0 #13935
Replies: 1 comment
|
The reason isn't the date format, it's that print(nlp.get_pipe("ner").labels)
# ('LOC', 'MISC', 'ORG', 'PER')For natural-language Spanish dates, skip the statistical NER and go rule-based. from dateparser.search import search_dates
search_dates(
"El acontecimiento histórico tuvo lugar el 23 de abril de 2021.",
languages=["es"],
)
# [('23 de abril de 2021', datetime.datetime(2021, 4, 23, 0, 0))]If you want them back inside the doc as spans, wrap that in a custom component and push the matches onto |
Uh oh!
There was an error while loading. Please reload this page.
Our org has a requirement for detecting spanish dates that are not in perfect format like dd/mm/yyyy (Predefined DateRecognizer is more then enough for that). But stuff like - "El acontecimiento histórico tuvo lugar el 23 de abril de 2021.". The english translation of it ("The historical event took place on April 23, 2021.") works quite well with en-core-web-lg, spacy identifies it well.
For spanish I am using es-core-news-lg version 3.8.0, but no luck with any kind of dates with months like the one above. Is the model not trained on such date datasets?
The following is my setup -
All reactions