91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

深度學(xué)習(xí),中文情感分析python程序,包含中文酒店用戶評(píng)論語料數(shù)據(jù)。

資源截圖

代碼片段和文件信息

#!/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

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????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個(gè)文件信息

評(píng)論

共有 條評(píng)論