Toggle navigation
Toggle navigation
This project
Loading...
Sign in
양지수
/
HCG_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
양지수
2021-04-18 19:19:41 +0900
1
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
62852a2ab98a822813bf22c9bbe03c5c4920fb65
62852a2a
1 parent
bb8c0981
명사만추출하기 작성중_미완
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
knp.py
knp.py
View file @
62852a2
...
...
@@ -5,7 +5,6 @@ from konlpy.tag import *
import
openpyxl
import
pandas
as
pd
from
math
import
log10
from
operator
import
itemgetter
import
numpy
as
np
#형태소분석라이브러리
...
...
@@ -82,7 +81,14 @@ print(TfIf)#TFIF는 (단어,가중치) 조합으로 저장
for
i
in
range
(
len
(
TfIf
)
-
1
):
TfIf
[
i
]
.
sort
(
key
=
lambda
x
:
x
[
1
],
reverse
=
True
)
#가중치기준 내림차순 정렬
print
(
TfIf
)
df
=
pd
.
DataFrame
.
from_records
(
TfIf
)
#TfIf dataframe으로 변환
df
.
to_excel
(
filename
+
'_가중치추출_내림정렬'
+
'.xlsx'
)
onlynouns
=
[]
for
i
in
range
(
len
(
TfIf
)
-
1
):
onlynouns
.
append
([])
for
j
in
range
(
len
(
TfIf
[
i
])
-
1
):
for
k
in
range
(
len
(
TfIf
[
i
][
j
])
+
1
):
if
k
%
2
==
0
:
onlynouns
[
i
]
.
append
(
TfIf
[
i
][
j
][
k
])
print
(
onlynouns
)
#df= pd.DataFrame.from_records(TfIf)#TfIf dataframe으로 변환
#df.to_excel(filename+'_가중치추출_내림정렬'+'.xlsx')
...
...
양지수
@2017104003 commented
2021-04-18 10:20:29 UTC
Master
가중치삭제 필요
Please
register
or
login
to post a comment