Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
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 18:06:08 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bb8c09818ac699e123f922455458c02709a2ae19
bb8c0981
1 parent
2fb6b76b
내립차순정렬추가
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
hmm1월_가중치추출.xlsx
knp.py
hmm1월_가중치추출.xlsx
0 → 100644
View file @
bb8c098
No preview for this file type
knp.py
View file @
bb8c098
...
...
@@ -6,6 +6,7 @@ import openpyxl
import
pandas
as
pd
from
math
import
log10
from
operator
import
itemgetter
import
numpy
as
np
#형태소분석라이브러리
#okt = Okt()
...
...
@@ -78,8 +79,10 @@ if __name__ == '__main__':
#print(result)
TfIf
.
append
(
result
)
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')
df
=
pd
.
DataFrame
.
from_records
(
TfIf
)
#TfIf dataframe으로 변환
df
.
to_excel
(
filename
+
'_가중치추출_내림정렬'
+
'.xlsx'
)
...
...
Please
register
or
login
to post a comment