Abhijit-2592 / spacy-langdetect

A fully customisable language detection pipeline for spaCy
MIT License
93 stars 6 forks source link

How to Hint language or define list of expected language #1

Closed yurilla56 closed 5 years ago

yurilla56 commented 5 years ago

Hello, is it possible to use list of languages for detection like ["en", "wit", "da"]?

Thank you in advance.

Abhijit-2592 commented 5 years ago

@yurilla56 This can be done. This is why we have language_detection_function argument in the Constructor. Write your own custom_detection_function and then return any python object you want. This will be stored in doc._.language, span._.language, token._.language