raport addeed

This commit is contained in:
s434695 2021-07-06 13:12:39 +02:00
parent 5d917fcffa
commit e3855d5411
7 changed files with 1924 additions and 1884 deletions

1
.~lock.Raport.docx# Normal file
View File

@ -0,0 +1 @@
,tomasz,tomasz-HP-EliteBook-8570p,06.07.2021 12:52,file:///home/tomasz/.config/libreoffice/4;

Binary file not shown.

BIN
Raport.pdf Normal file

Binary file not shown.

33
svm.py Normal file
View File

@ -0,0 +1,33 @@
import pandas as pd
import numpy as np
from nltk.tokenize import word_tokenize
from nltk import pos_tag
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from sklearn.preprocessing import LabelEncoder
from collections import defaultdict
from nltk.corpus import wordnet as wn
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import model_selection, naive_bayes, svm
from sklearn.metrics import accuracy_score
from sklearn.pipeline import make_pipeline
with open("train/in.tsv") as f:
x_train = f.readlines()
with open("train/expected.tsv") as f:
y_train = f.readlines()
with open("dev-0/in.tsv") as f:
x_dev = f.readlines()
y_train = LabelEncoder().fit_transform(y_train)
y_train
pipeline = make_pipeline(TfidfVectorizer(),svm.SVC())
model = pipeline.fit(x_train, y_train)
prediction = model.predict(x_dev)
np.savetxt("svm/out.tsv", prediction, fmt='%d')

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -12,3 +12,9 @@ F1.0 0.6143
Precision 0.6842
Recall 0.5573
SVM:
Likelihood 0.0000
Accuracy 0.8249
F1.0 0.7355
Precision 0.7905
Recall 0.6876