This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Unigrams | |
#previous word | |
U00:%x[-1,0] | |
#current word | |
U01:%x[0,0] | |
#next word | |
U02:%x[1,0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
राहुल कहॉं है ? રાહુલ ક્યાં છે ? | |
राहुल और काजोल बगीचे में हैं । રાહુલ અને કાજોલ બગીચામાં છે. | |
आज मौसम अच्छा है, बहुत गरमी है । આજે હવામાન સારું છે, ખૂબ ગરમી છે. | |
लेकिन कल बहुत ठंडा था । પણ ગઇકાલે બહુ ઠંડી હતી. | |
तब वे बाहर खेल नहीं सके ત્યારે તે બાહર રમી શક્યા | |
राहुल और काजोल को खेलना पसंद है । રાહુલ અને કાજોલને રમવાનું ગમે છે | |
वे हमेशा बड़े घर के सामने वाले बगीचे में साथ में खेलते हैं તેઓ હંમેશા મોટા ઘરની સામેના બગીચામાં સાથે રમે છે | |
राहुल छ: साल का एक छोटा लड़का है રાહુલ છ વર્ષનો એક નાનો છોકરો છે | |
वह छोटी लड़की राहुल की बहन है, वह पाँच वर्ष की है। તે નાની છોકરી રાહુલની બહેન છે, તે પાંચ વર્ષની છે. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |