I use some rule-based and statistical POS tags to tag the corpus (about 5,000 sentences ) with parts of speech (POS). Below is a snippet of my test case, in which each word is separated by the corresponding POS tag by '/'.
No/RB ,/, it/PRP was/VBD n't/RB Black/NNP Monday/NNP ./. But/CC while/IN the/DT New/NNP York/NNP Stock/NNP Exchange/NNP did/VBD n't/RB fall/VB apart/RB Friday/NNP as/IN the/DT Dow/NNP Jones/NNP Industrial/NNP Average/NNP plunged/VBD 190.58/CD points/NNS --/: most/JJS of/IN it/PRP in/IN the/DT final/JJ hour/NN --/: it/PRP barely/RB managed/VBD *-2/-NONE- to/TO stay/VB this/DT side/NN of/IN chaos/NN ./. Some/DT ``/`` circuit/NN breakers/NNS ''/'' installed/VBN */-NONE- after/IN the/DT October/NNP 1987/CD crash/NN failed/VBD their/PRP$ first/JJ test/NN ,/, traders/NNS say/VBP 0/-NONE- *T*-1/-NONE- ,/, *-2/-NONE- unable/JJ *-3/-NONE- to/TO cool/VB the/DT selling/NN panic/NN in/IN both/DT stocks/NNS and/CC futures/NNS ./.
After marking the case, it looks like this:
No/DT ,/, it/PRP was/VBD n't/RB Black/NNP Monday/NNP ./. But/CC while/IN the/DT New/NNP York/NNP Stock/NNP Exchange/NNP did/VBD n't/RB fall/VB apart/RB Friday/VB as/IN the/DT Dow/NNP Jones/NNP Industrial/NNP Average/JJ plunged/VBN 190.58/CD points/NNS --/: most/RBS of/IN it/PRP in/IN the/DT final/JJ hour/NN --/: it/PRP barely/RB managed/VBD *-2/-NONE- to/TO stay/VB this/DT side/NN of/IN chaos/NNS ./. Some/DT ``/`` circuit/NN breakers/NNS ''/'' installed/VBN */-NONE- after/IN the/DT October/NNP 1987/CD crash/NN failed/VBD their/PRP$ first/JJ test/NN ,/, traders/NNS say/VB 0/-NONE- *T*-1/-NONE- ,/, *-2/-NONE- unable/JJ *-3/-NONE- to/TO cool/VB the/DT selling/VBG panic/NN in/IN both/DT stocks/NNS and/CC futures/NNS ./.
I need to calculate the accuracy of tags ( Tag wise-Recall and Precision ), so you need to find the error (if any) in the mark for each pair of tag words.
The approach I'm thinking of is to scroll through these 2 text files and save them in a list, and then compare the "two" element by element.
The approach seems very rude to me, so you guys would suggest some better solution to the above problem.
On the wikipedia page:
In the classification problem, accuracy for a class is the number of true positives (i.e., the number of elements marked as belonging to a positive class) divided by the total number of elements marked as belonging to a positive class (i.e., the sum of true positive and false positive elements, which incorrectly relate to elements marked as belonging to the class). Feedback in this context is defined as the number of true positive divisions by the total number of elements that actually belong to the positive class (i.e., the sum of true positive and false negatives that were not marked as belonging to the positive class, but should have been).
python shell text-processing machine-learning nlp
stressed_geek
source share