Showing
13 changed files
with
17 additions
and
19 deletions
| ... | @@ -137,28 +137,26 @@ def word2features(sent, i, S1, S2): | ... | @@ -137,28 +137,26 @@ def word2features(sent, i, S1, S2): |
| 137 | 137 | ||
| 138 | #====================== S1 ======================# | 138 | #====================== S1 ======================# |
| 139 | if S1: | 139 | if S1: |
| 140 | - listElem = sent[i - 1].split('|') | 140 | + print("S1") |
| 141 | - lemma1 = listElem[1] | ||
| 142 | - postag1 = listElem[2] | ||
| 143 | 141 | ||
| 144 | - features['hUpper']: hUpper(word) | 142 | + features['hUpper']= hUpper(word) |
| 145 | - features['hLower']: hUpper(word) | 143 | + features['hLower']= hUpper(word) |
| 146 | - features['hGreek']: hGreek(word) | 144 | + features['hGreek']= hGreek(word) |
| 147 | - features['symb']: symb(word) | 145 | + features['symb']= symb(word) |
| 148 | #firstChar | 146 | #firstChar |
| 149 | - features['lemma1[:1]']: lemma1[:1] | 147 | + features['lemma[:1]']= lemma[:1] |
| 150 | - #secondChar | 148 | + features['postag[:1]']= postag[:1] |
| 151 | - features['postag[:1]']: lemma1[:1] | 149 | + #secondChar |
| 152 | - features['postag[:2]']: lemma1[:2] | 150 | + features['postag[:2]']= postag[:2] |
| 153 | - features['lemma[:2]']: lemma1[:2] | 151 | + features['lemma[:2]']= lemma[:2] |
| 154 | 152 | ||
| 155 | #====================== S2 ======================# | 153 | #====================== S2 ======================# |
| 156 | - if S2: | 154 | + if S2: |
| 157 | - #S2 | 155 | + print("S2") |
| 158 | - features['isUpper']: word.isupper() | 156 | + features['isUpper']= word.isupper() |
| 159 | - features['isLower']: word.isLower() | 157 | + features['isLower']= word.islower() |
| 160 | - features['isGreek']: isGreek(word) | 158 | + features['isGreek']= isGreek(word) |
| 161 | - features['isNumber']: word.isdigit() | 159 | + features['isNumber'] = word.isdigit() |
| 162 | 160 | ||
| 163 | 161 | ||
| 164 | ''' | 162 | ''' |
| ... | @@ -348,7 +346,7 @@ if __name__ == "__main__": | ... | @@ -348,7 +346,7 @@ if __name__ == "__main__": |
| 348 | # crf = rs.best_estimator_ | 346 | # crf = rs.best_estimator_ |
| 349 | 347 | ||
| 350 | 348 | ||
| 351 | - nameReport = str(options.S1) + '_S2_' + str(options.S2) + str(options.version) + '.txt' | 349 | + nameReport = 'S1_' + str(options.S1) + '_S2_' + str(options.S2) + str(options.version) + '.txt' |
| 352 | with open(os.path.join(options.outputPath, "reports", "report_" + nameReport), mode="w") as oFile: | 350 | with open(os.path.join(options.outputPath, "reports", "report_" + nameReport), mode="w") as oFile: |
| 353 | oFile.write("********** TRAINING AND TESTING REPORT **********\n") | 351 | oFile.write("********** TRAINING AND TESTING REPORT **********\n") |
| 354 | oFile.write("Training file: " + options.trainingFile + '\n') | 352 | oFile.write("Training file: " + options.trainingFile + '\n') | ... | ... |
No preview for this file type
CRF/models/model_S1_False_S2_False_v2.mod
0 → 100644
No preview for this file type
No preview for this file type
No preview for this file type
CRF/models/model_S1_True_S2_False_v2.mod
0 → 100644
No preview for this file type
No preview for this file type
This diff is collapsed. Click to expand it.
CRF/reports/report_S1_False_S2_False_v2.txt
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
CRF/reports/report_S1_True_S2_False_v2.txt
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment