Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load Ukrainian embeddings and taggers #3026

Merged
merged 2 commits into from
Dec 19, 2022
Merged

Load Ukrainian embeddings and taggers #3026

merged 2 commits into from
Dec 19, 2022

Conversation

lukasgarbas
Copy link
Collaborator

Added links for Ukrainian forward and backward Flair embeddings:

# Load Ukrainian Flair embeddings
from flair.embeddings import FlairEmbeddings

flair_uk_forward = FlairEmbeddings('uk-forward')
flair_uk_backward = FlairEmbeddings('uk-backward')

and two taggers: NER and POS

# Load Ukrainian NER and POS taggers
from flair.models import SequenceTagger

ner_tagger = SequenceTagger.load('ner-ukrainian')
pos_tagger = SequenceTagger.load('pos-ukrainian')

# Tag a sentence
from flair.data import Sentence
sentence = Sentence("Сьогодні в Знам’янці проживають нащадки поета — родина Шкоди.")

ner_tagger.predict(sentence)
pos_tagger.predict(sentence)

print(sentence)
# ”Сьогодні в Знам’янці проживають нащадки поета — родина Шкоди." → 
# [“Сьогодні"/ADV, "в"/ADP, "Знам’янці"/LOC, "Знам’янці"/PROPN, "проживають”/VERB, "нащадки"/NOUN, "поета"/NOUN, "—"/PUNCT, "родина"/NOUN, "Шкоди”/PERS, "Шкоди"/PROPN, "."/PUNCT]

added uk-forward and uk-backward to flair embedding map (links from huggingface hub)
added ukrainian NER and POS taggers
@alanakbik alanakbik merged commit 117e14e into flairNLP:master Dec 19, 2022
@alanakbik
Copy link
Collaborator

@lukasgarbas thanks for adding this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants