Skip to content

Implementation of Average Perceptron to tag Parts of Speech of given text using POS and NER tagging

Notifications You must be signed in to change notification settings

RekhaMandyaRaju/Average-Perceptron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Part I

Execution of Perceptron

To learn from training file execute following command

python3 perceplearn.py TRAININGFILE MODELFILE

To classify the TEST_DATA taken from STDIN execute the following command

cat TEST_DATA | python3 percepclassify.py MODELFILE

where MODELFILE is the modelfile generated by perceplearn.py

Part II

POS TAGGING

To learn from training file execute following command

python3 postrain.py TRAININGFILE MODEL

where postrain calls perceplearn.py through system call to obtain the MODEL file

To classify the TEST_DATA taken from STDIN execute the following command

cat TEST_DATA | python3 postag.py MODELFILE

where MODELFILE is the modelfile generated by postrain.py

Part III

NER TAGGING

To learn from training file execute following command

python3 netrain.py TRAININGFILE MODEL

where netrain calls perceplearn.py through system call to obtain the MODEL file

To classify the TEST_DATA taken from STDIN execute the following command

cat TEST_DATA | python3 netag.py MODELFILE

where MODELFILE is the modelfile generated by netrain.py

Part IV

a)Accuracy of POS Tagger Accuracy of POS Tagger when classification is done using Perceptron is 94.06

b)F-SCORE of NER Tagging LOCATION F-SCORE - 0.6687179487179487 PRECISION - 0.6626016260162602 RECALL - 0.6749482401656315

          ORG
F-SCORE    - 0.6679438058748404
PRECISION  - 0.6163818503241013
RECALL     - 0.7289198606271777

         PERSON
F-SCORE    - 0.6689254598257502
PRECISION  - 0.5654664484451718
RECALL     - 0.8187203791469194

         MISC
F-SCORE    - 0.4065040650406504
PRECISION  - 0.449438202247191
RECALL     - 0.37105751391465674

C)When Naive Baye's Classifier is used instead of Perceptron

POS_TAGGING when Naive Baye's Classifier IS USED ACCURACY - 0.9025680025330689

POS_TAGGING WHEN PERCEPTRON IS USED ACCURACY - 0.94018560123701

There is decrease in performance metrics of POS tagging when Naive Baye's classifier is used for classification. The performance of perceptron is high when compared to Naive Baye's classifier. This is because of the mentioned below reasons:

*Naive Baye's classifier uses Probablistic determination method whereas Perceptron uses discriminative method while learning training data. *There is only one iteration in Naive Baye's classifier where as Perceptron uses multiple iterations till the maximum weight is obtained *Naive Baye's classifier do not update on mistakes where as Perceptron updates the weight when mistake is made. *Naive Baye's classifier considers bag of word features whereas Perceptron may use the context of the word.

About

Implementation of Average Perceptron to tag Parts of Speech of given text using POS and NER tagging

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages