양지수

데이터저장형식결정필요

Showing 356 changed files with 147 additions and 0 deletions
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
# KNU 한국어 감성사전
# 작성자 : 온병원, 박상민, 나철원
# 소속 : 군산대학교 소프트웨어융합공학과 Data Intelligence Lab
# 홈페이지 : dilab.kunsan.ac.kr
# 작성일 : 2018.05.14
# 뜻풀이 데이터 출처 : https://github.com/mrchypark/stdkor
# 신조어 데이터 출처 : https://ko.wikipedia.org/wiki/%EB%8C%80%ED%95%9C%EB%AF%BC%EA%B5%AD%EC%9D%98_%EC%9D%B8%ED%84%B0%EB%84%B7_%EC%8B%A0%EC%A1%B0%EC%96%B4_%EB%AA%A9%EB%A1%9D
# 이모티콘 데이터 출처: https://ko.wikipedia.org/wiki/%EC%9D%B4%EB%AA%A8%ED%8B%B0%EC%BD%98
# SentiWordNet_3.0.0_20130122 데이터 출처 : http://sentiwordnet.isti.cnr.it/
# SenticNet-5.0 데이터 출처 : http://sentic.net/
# 감정단어사전0603 데이터 출처 : http://datascience.khu.ac.kr/board/bbs/board.php?bo_table=05_01&wr_id=91
# 김은영, “국어 감정동사 연구”, 2004.02, 학위논문(박사) - 전남대학교 국어국문학과 대학원
#-*-coding:utf-8-*-
import json
import warnings
warnings.simplefilter(("ignore"))
import openpyxl
import pandas as pd
class KnuSL():
def data_list(wordname):
with open('KnuSentiLex/data/SentiWord_info.json', encoding='utf-8-sig', mode='r') as f:
data = json.load(f)
result = ['X','X']
for i in range(0, len(data)):
if data[i]['word'] == wordname:
result.pop()
result.pop()
result.append(data[i]['word_root'])
result.append(data[i]['polarity'])
r_word = result[0] #어근
s_word = result[1] #극성
return s_word
if __name__ == "__main__":
ksl = KnuSL
print("\nKNU 한국어 감성사전입니다~ :)")
print("사전에 단어가 없는 경우 결과가 None으로 나타납니다!!!")
print("종료하시려면 #을 입력해주세요!!!")
print("-2:매우 부정, -1:부정, 0:중립 or Unkwon, 1:긍정, 2:매우 긍정")
print("\n")
filefolder = input("종목폴더입력: ")
filename=input("파일이름입력:")
filepos = "C:/Users/yangj/PycharmProjects/pythonProject1/뉴스키워드/"+filefolder+"/" + filename + ".xlsx"
kfile = openpyxl.load_workbook(filepos)#파일이름입력
ws=kfile.active
data=[]
i=0
for row in ws.rows:
data.append([])
for cell in row:
if cell.value != None:
data[i].append(cell.value)
i += 1
print(type(data))
del data[0] #첫번째 의미없는 열 삭제
for i in range(len(data)):
del data[i][0] #각 열의 첫번째 행 삭제
print(data)
KNUdata=[]
for x in range(len(data)):
KNUdata.append([])
for y in range(len(data[x])):
KNUdata[x].append(ksl.data_list(data[x][y]))
df_list = pd.DataFrame(data)
df_knu = pd.DataFrame(KNUdata)
result = pd.concat([ df_list, df_knu], axis=1) #TfIf dataframe으로 변환
result.to_excel(filename+' KNU'+'.xlsx')
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/knu.iml" filepath="$PROJECT_DIR$/.idea/knu.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
<mapping directory="$PROJECT_DIR$/KnuSentiLex" vcs="Git" />
</component>
</project>
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
Metadata-Version: 2.1
Name: mecab-python
Version: 0.996-ko-0.9.2-msvc
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Platform: UNKNOWN
UNKNOWN
MeCab.py,sha256=cuvFTwJk_Z38aY54gIKoBtR46p6tPXOVSKkpoA1PcY4,15733
_MeCab.cp37-win_amd64.pyd,sha256=u-WVy7oAK9dySDKhPh_DNHIWW4x6yHSwu6hjMKqdz5E,116736
__pycache__/MeCab.cpython-37.pyc,,
libmecab.dll,sha256=lRhwboyrXWEXXnDn8soNA05id3UvWfPpP7bvTXj5iH4,1908736
mecab_python-0.996_ko_0.9.2_msvc.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
mecab_python-0.996_ko_0.9.2_msvc.dist-info/METADATA,sha256=Qw4D_1k4TCzF1Ul5k47s6hOnafUJSLyiiGhqffEnszs,190
mecab_python-0.996_ko_0.9.2_msvc.dist-info/RECORD,,
mecab_python-0.996_ko_0.9.2_msvc.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
mecab_python-0.996_ko_0.9.2_msvc.dist-info/WHEEL,sha256=jmFYSwR2oi5DgMGgmnuB-EJxqLMkUojGGdmJ0wz35aI,106
mecab_python-0.996_ko_0.9.2_msvc.dist-info/direct_url.json,sha256=8Wv8YjFpjisUlH--mXnzxpj5B8uexD6AtZjonw2yk5k,142
mecab_python-0.996_ko_0.9.2_msvc.dist-info/top_level.txt,sha256=E6HHbCcV114TjQmzLJGG5aSu2Sb0tjGGxkjler1jxrQ,13
Wheel-Version: 1.0
Generator: bdist_wheel (0.31.1)
Root-Is-Purelib: false
Tag: cp37-cp37m-win_amd64
{"archive_info": {}, "url": "file:///C:/Users/yangj/PycharmProjects/pythonProject1/mecab_python-0.996_ko_0.9.2_msvc-cp37-cp37m-win_amd64.whl"}
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type