Reem
Reem

Reputation: 139

Using Spacy functionalities for Arabic Language

I want to train a model on NER annotation and then use it to perform information extraction.

Also I want to see how spaCy's built-in visualizer detected the NEs in the document for Arabic language, and how a dependency parse encodes grammatical information by using spaCy's dependency visualizer to help in extracting the relations.

Basically, I'm transforming the work that has been done in this link but for Arabic language and with some modifications on the NER task, as I want to train the model on my NER classes.

import spacy
import spacy_transformers
nlp = spacy.blank("ar") # empty English pipeline
# create the config with the name of your model
# values omitted will get default values
config = {
    "model": {
        "@architectures": "spacy-transformers.TransformerModel.v3",
        "name": "aubmindlab/bert-large-arabertv02"
    }
}
nlp.add_pipe("transformer", config=config)
nlp.initialize() # XXX don't forget this step!
doc = nlp("فريك الذرة لذيذة")
print(doc._.trf_data) # all the Transformer output is stored here  

Is that possible? and if so, what are the steps that I need to do in order to accomplish the task?

I appreciate any helpful examples and resources.

Upvotes: 1

Views: 1153

Answers (0)

Related Questions