资源简介
深度学习,中文情感分析python程序,包含中文酒店用户评论语料数据。

代码片段和文件信息
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from copy import deepcopy
import re
try:
import psyco
psyco.full()
except:
pass
try:
from zh_wiki import zh2Hant zh2Hans
except ImportError:
from zhtools.zh_wiki import zh2Hant zh2Hans
import sys
py3k = sys.version_info >= (3 0 0)
if py3k:
UEMPTY = ‘‘
else:
_zh2Hant _zh2Hans = {} {}
for old new in ((zh2Hant _zh2Hant) (zh2Hans _zh2Hans)):
for k v in old.items():
new[k.decode(‘utf8‘)] = v.decode(‘utf8‘)
zh2Hant = _zh2Hant
zh2Hans = _zh2Hans
UEMPTY = ‘‘.decode(‘utf8‘)
# states
(START END FAIL WAIT_TAIL) = list(range(4))
# conditions
(TAIL ERROR MATCHED_SWITCH UNMATCHED_SWITCH CONNECTOR) = list(range(5))
MAPS = {}
class Node(object):
def __init__(self from_word to_word=None is_tail=True
have_child=False):
self.from_word = from_word
if to_word is None:
self.to_word = from_word
self.data = (is_tail have_child from_word)
self.is_original = True
else:
self.to_word = to_word or from_word
self.data = (is_tail have_child to_word)
self.is_original = False
self.is_tail = is_tail
self.have_child = have_child
def is_original_long_word(self):
return self.is_original and len(self.from_word)>1
def is_follow(self chars):
return chars != self.from_word[:-1]
def __str__(self):
return ‘‘ % (repr(self.from_word)
repr(self.to_word) self.is_tail self.have_child)
__repr__ = __str__
class ConvertMap(object):
def __init__(self name mapping=None):
self.name = name
self._map = {}
if mapping:
self.set_convert_map(mapping)
def set_convert_map(self mapping):
convert_map = {}
have_child = {}
max_key_length = 0
for key in sorted(mapping.keys()):
if len(key)>1:
for i in range(1 len(key)):
parent_key = key[:i]
have_child[parent_key] = True
have_child[key] = False
max_key_length = max(max_key_length len(key))
for key in sorted(have_child.keys()):
convert_map[key] = (key in mapping have_child[key]
mapping.get(key UEMPTY))
self._map = convert_map
self.max_key_length = max_key_length
def __getitem__(self k):
try:
is_tail have_child to_word = self._map[k]
return Node(k to_word is_tail have_child)
except:
return Node(k)
def __contains__(self k):
return k in self._map
def __len__(self):
return len(self._map)
class StatesMachineException(Exception): pass
class StatesMachine(object):
def __init__(self):
self.state = START
self.final = UEMPTY
self.len = 0
self.pool = UEMPTY
def cl
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-11-11 08:52 中文情感分析python程序\
目录 0 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\
文件 40333 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\chinese_sentiment_analysis.ipynb
目录 0 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\
文件 15182 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\chinese_stop_words.txt
目录 0 2018-11-11 08:53 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\
目录 0 2018-11-11 08:53 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\
文件 80 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.0.txt
文件 204 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1.txt
文件 239 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.10.txt
文件 382 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.100.txt
文件 987 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1000.txt
文件 152 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1001.txt
文件 202 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1002.txt
文件 57 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1003.txt
文件 119 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1004.txt
文件 54 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1005.txt
文件 320 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1006.txt
文件 132 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1007.txt
文件 325 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1008.txt
文件 325 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1009.txt
文件 382 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.101.txt
文件 270 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1010.txt
文件 385 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1011.txt
文件 767 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1012.txt
文件 228 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1013.txt
文件 279 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1014.txt
文件 174 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1015.txt
文件 60 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1016.txt
文件 60 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1017.txt
文件 220 2018-11-11 08:52 中文情感分析python程序\中文情感分析_sentiment_analysis\data\ChnSentiCorp_htl_ba_6000\neg\neg.1018.txt
............此处省略5896个文件信息
相关资源
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
评论
共有 条评论