Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
E
exa_news_classificator
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vasyl Bodnaruk
exa_news_classificator
Commits
5163f92a
Commit
5163f92a
authored
Sep 04, 2017
by
Tags
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change to 50%
parent
ce54f918
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
news_classify_tag.py
news_classify_tag.py
+3
-3
requirements.txt
requirements.txt
+1
-0
No files found.
news_classify_tag.py
View file @
5163f92a
...
...
@@ -5,7 +5,6 @@ import nltk
import
numpy
as
np
import
_mysql
# noinspection PyUnresolvedReferences
class
Classifier
:
def
__init__
(
self
,
corpus
=
None
,
host
=
'176.58.117.151'
,
user
=
'esi'
,
password
=
'esi12345'
,
db
=
'esi'
,
port
=
3306
):
...
...
@@ -163,7 +162,7 @@ class Classifier:
# exit(0)
@
property
def
tag_accordance
(
self
,
persantage
=
1
0
):
def
tag_accordance
(
self
,
persantage
=
5
0
):
"""
Class method for computing
%
af tag accordance
:return: tuple of
%
af tag accordance
...
...
@@ -179,7 +178,8 @@ class Classifier:
if
item
[
1
]
<
persantage
/
100
:
continue
# print (item[0], item[1], self.tags[item[0] - 1][1].decode ("ascii", 'ignore'), end=", ")
vector_accordance
.
append
(
(
item
[
0
],
int
(
item
[
1
]
*
1000
)
/
10
,
self
.
tags
[
item
[
0
]
-
1
][
1
]
.
decode
(
"ascii"
,
'ignore'
)))
(
item
[
0
],
int
(
item
[
1
]
*
1000
)
/
10
,
self
.
tags
[
item
[
0
]
-
1
][
1
]
.
decode
(
"ascii"
,
'ignore'
)))
return
vector_accordance
...
...
requirements.txt
View file @
5163f92a
spacy
DateTime
==4.2
mysqlclient
==1.3.10
nltk
==3.2.4
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment