Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm-text-miner
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
gm-text-miner
Commits
d5440a7e
Commit
d5440a7e
authored
Jan 07, 2021
by
crazyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
text miner
parent
21e4e037
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
10 deletions
+12
-10
base.cpython-37.pyc
algorithm/text_classifical/__pycache__/base.cpython-37.pyc
+0
-0
base.py
algorithm/text_classifical/base.py
+4
-3
base.py
build/lib/algorithm/text_classifical/base.py
+4
-3
filter.py
build/lib/preprocesser/filter.py
+2
-2
filter.cpython-37.pyc
preprocesser/__pycache__/filter.cpython-37.pyc
+0
-0
processors.cpython-37.pyc
preprocesser/__pycache__/processors.cpython-37.pyc
+0
-0
filter.py
preprocesser/filter.py
+2
-2
No files found.
algorithm/text_classifical/__pycache__/base.cpython-37.pyc
View file @
d5440a7e
No preview for this file type
algorithm/text_classifical/base.py
View file @
d5440a7e
...
@@ -8,6 +8,7 @@ from preprocesser.filter import stopwords_filter
...
@@ -8,6 +8,7 @@ from preprocesser.filter import stopwords_filter
from
collections
import
Counter
from
collections
import
Counter
from
config
import
config
from
config
import
config
import
os
import
os
import
codecs
class
SELECTED_CONTENT_TYPE
():
class
SELECTED_CONTENT_TYPE
():
...
@@ -28,21 +29,21 @@ class TextClassifical(object):
...
@@ -28,21 +29,21 @@ class TextClassifical(object):
def
build_network_influencer_words
(
self
,
word_path
):
def
build_network_influencer_words
(
self
,
word_path
):
ret
=
{}
ret
=
{}
for
line
in
open
(
word_path
,
"r"
,
errors
=
"ignore"
):
for
line
in
codecs
.
open
(
word_path
,
"r"
,
errors
=
"ignore"
):
line
=
line
.
strip
()
line
=
line
.
strip
()
ret
[
line
]
=
1
ret
[
line
]
=
1
return
ret
return
ret
def
build_project_words
(
self
,
project_path
):
def
build_project_words
(
self
,
project_path
):
ret
=
{}
ret
=
{}
for
line
in
open
(
project_path
,
"r"
,
errors
=
"ignore"
):
for
line
in
codecs
.
open
(
project_path
,
"r"
,
errors
=
"ignore"
):
line
=
line
.
strip
()
line
=
line
.
strip
()
ret
[
line
]
=
1
ret
[
line
]
=
1
return
ret
return
ret
def
build_star_words
(
self
,
star_path
):
def
build_star_words
(
self
,
star_path
):
ret
=
{}
ret
=
{}
for
line
in
open
(
star_path
,
"r"
,
errors
=
"ignore"
):
for
line
in
codecs
.
open
(
star_path
,
"r"
,
errors
=
"ignore"
):
line
=
line
.
strip
()
line
=
line
.
strip
()
ret
[
line
]
=
1
ret
[
line
]
=
1
return
ret
return
ret
...
...
build/lib/algorithm/text_classifical/base.py
View file @
d5440a7e
...
@@ -8,6 +8,7 @@ from preprocesser.filter import stopwords_filter
...
@@ -8,6 +8,7 @@ from preprocesser.filter import stopwords_filter
from
collections
import
Counter
from
collections
import
Counter
from
config
import
config
from
config
import
config
import
os
import
os
import
codecs
class
SELECTED_CONTENT_TYPE
():
class
SELECTED_CONTENT_TYPE
():
...
@@ -28,21 +29,21 @@ class TextClassifical(object):
...
@@ -28,21 +29,21 @@ class TextClassifical(object):
def
build_network_influencer_words
(
self
,
word_path
):
def
build_network_influencer_words
(
self
,
word_path
):
ret
=
{}
ret
=
{}
for
line
in
open
(
word_path
,
"r"
,
errors
=
"ignore"
):
for
line
in
codecs
.
open
(
word_path
,
"r"
,
errors
=
"ignore"
):
line
=
line
.
strip
()
line
=
line
.
strip
()
ret
[
line
]
=
1
ret
[
line
]
=
1
return
ret
return
ret
def
build_project_words
(
self
,
project_path
):
def
build_project_words
(
self
,
project_path
):
ret
=
{}
ret
=
{}
for
line
in
open
(
project_path
,
"r"
,
errors
=
"ignore"
):
for
line
in
codecs
.
open
(
project_path
,
"r"
,
errors
=
"ignore"
):
line
=
line
.
strip
()
line
=
line
.
strip
()
ret
[
line
]
=
1
ret
[
line
]
=
1
return
ret
return
ret
def
build_star_words
(
self
,
star_path
):
def
build_star_words
(
self
,
star_path
):
ret
=
{}
ret
=
{}
for
line
in
open
(
star_path
,
"r"
,
errors
=
"ignore"
):
for
line
in
codecs
.
open
(
star_path
,
"r"
,
errors
=
"ignore"
):
line
=
line
.
strip
()
line
=
line
.
strip
()
ret
[
line
]
=
1
ret
[
line
]
=
1
return
ret
return
ret
...
...
build/lib/preprocesser/filter.py
View file @
d5440a7e
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
# software: PyCharm
# software: PyCharm
import
re
,
os
import
re
,
os
from
config
import
config
from
config
import
config
import
codecs
class
Filter
(
object
):
class
Filter
(
object
):
def
__init__
(
self
,
file_path
,
encoding
=
"utf-8"
):
def
__init__
(
self
,
file_path
,
encoding
=
"utf-8"
):
...
@@ -26,7 +26,7 @@ class StopwordsFilter(Filter):
...
@@ -26,7 +26,7 @@ class StopwordsFilter(Filter):
return
re
.
sub
(
u"([^
\u4e00
-
\u9fa5\u0030
-
\u0039\u0041
-
\u005a\u0061
-
\u007a
])"
,
""
,
corpus
)
return
re
.
sub
(
u"([^
\u4e00
-
\u9fa5\u0030
-
\u0039\u0041
-
\u005a\u0061
-
\u007a
])"
,
""
,
corpus
)
def
init
(
self
):
def
init
(
self
):
for
line
in
open
(
self
.
file_path
,
"r"
,
encoding
=
self
.
encoding
):
for
line
in
codecs
.
open
(
self
.
file_path
,
"r"
,
encoding
=
self
.
encoding
):
try
:
try
:
line
=
line
.
strip
()
line
=
line
.
strip
()
self
.
stopwords
.
add
(
line
)
self
.
stopwords
.
add
(
line
)
...
...
preprocesser/__pycache__/filter.cpython-37.pyc
View file @
d5440a7e
No preview for this file type
preprocesser/__pycache__/processors.cpython-37.pyc
View file @
d5440a7e
No preview for this file type
preprocesser/filter.py
View file @
d5440a7e
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
# software: PyCharm
# software: PyCharm
import
re
,
os
import
re
,
os
from
config
import
config
from
config
import
config
import
codecs
class
Filter
(
object
):
class
Filter
(
object
):
def
__init__
(
self
,
file_path
,
encoding
=
"utf-*"
):
def
__init__
(
self
,
file_path
,
encoding
=
"utf-*"
):
...
@@ -26,7 +26,7 @@ class StopwordsFilter(Filter):
...
@@ -26,7 +26,7 @@ class StopwordsFilter(Filter):
return
re
.
sub
(
u"([^
\u4e00
-
\u9fa5\u0030
-
\u0039\u0041
-
\u005a\u0061
-
\u007a
])"
,
""
,
corpus
)
return
re
.
sub
(
u"([^
\u4e00
-
\u9fa5\u0030
-
\u0039\u0041
-
\u005a\u0061
-
\u007a
])"
,
""
,
corpus
)
def
init
(
self
):
def
init
(
self
):
for
line
in
open
(
self
.
file_path
,
"r"
,
encoding
=
self
.
encoding
):
for
line
in
codecs
.
open
(
self
.
file_path
,
"r"
,
encoding
=
self
.
encoding
):
try
:
try
:
line
=
line
.
strip
()
line
=
line
.
strip
()
self
.
stopwords
.
add
(
line
)
self
.
stopwords
.
add
(
line
)
...
...
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