Views
No views yet
from flair.models import TextClassifier
from flair.data import Sentence
# load the model
classifier = TextClassifier.load('noharm-ai/substance-prediction')
# make a sentence
sentence = Sentence('Tylenon 750 mg')
# predict Substance tags
classifier.predict(sentence)
# print the sentence with the tags
print(sentence)