Skip to content

Instantly share code, notes, and snippets.

View kindleton's full-sized avatar

Raveesh Motlani kindleton

View GitHub Profile
@kindleton
kindleton / crf_accuracy.py
Created March 1, 2016 23:37
Calculate accuracy for CRF++ output file
import sys
f1 = open(sys.argv[1])
count = 0
true = 0
false = 0
sentences = 0
for line in f1:
if line == '\n' or line.split()==[]:
sentences+=1
@kindleton
kindleton / hin_guj_story.txt
Last active March 14, 2016 11:29
Hindi - Gujarati story
राहुल कहॉं है ? રાહુલ ક્યાં છે ?
राहुल और काजोल बगीचे में हैं । રાહુલ અને કાજોલ બગીચામાં છે.
आज मौसम अच्छा है, बहुत गरमी है । આજે હવામાન સારું છે, ખૂબ ગરમી છે.
लेकिन कल बहुत ठंडा था । પણ ગઇકાલે બહુ ઠંડી હતી.
तब वे बाहर खेल नहीं सके ત્યારે તે બાહર રમી શક્યા
राहुल और काजोल को खेलना पसंद है । રાહુલ અને કાજોલને રમવાનું ગમે છે
वे हमेशा बड़े घर के सामने वाले बगीचे में साथ में खेलते हैं તેઓ હંમેશા મોટા ઘરની સામેના બગીચામાં સાથે રમે છે
राहुल छ: साल का एक छोटा लड़का है રાહુલ છ વર્ષનો એક નાનો છોકરો છે
वह छोटी लड़की राहुल की बहन है, वह पाँच वर्ष की है। તે નાની છોકરી રાહુલની બહેન છે, તે પાંચ વર્ષની છે.
import sys
from sklearn.metrics import classification_report
if len(sys.argv) < 2 :
print "Usage : python code.py pairFile"
sys.exit(1)
#pair file means, a file with (actual label, predicted label) pairs
pairFile = open(sys.argv[1],'r+')
report = open('report.txt','w')
#Unigrams
#previous word
U00:%x[-1,0]
#current word
U01:%x[0,0]
#next word
U02:%x[1,0]