Last active
April 3, 2023 16:34
-
-
Save frutik/c42751d81842f8aa3f0005d9518dbb58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from spacy.pipeline import EntityRuler | |
import spacy | |
nlp = spacy.blank("nl") | |
ruler = nlp.add_pipe("entity_ruler") | |
ruler.from_disk('fb.jsonl') | |
doc = nlp("I like Ralph Lauren and fruit of THE LOOM") | |
print([(ent.text, ent.label_) for ent in doc.ents]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"label":"FASHION_BRAND","pattern":[{"lower":"fruit"},{"lower":"of"},{"lower":"the"},{"lower":"loom"}]} | |
{"label":"FASHION_BRAND","pattern":[{"lower":"ralph"},{"lower":"lauren"}]} | |
{"label":"FASHION_BRAND","pattern":[{"lower":"uniqlo"}]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment