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

資源簡介

對話情緒識別 對話情緒識別適用于聊天、客服等多個場景,能夠幫助企業更好地把握對話質量、改善產品的用戶交互體驗,也能分析客服服務質量、降低人工質檢成本。 對話情緒識別(Emotion Detection,簡稱EmoTect),專注于識別智能對話場景中用戶的情緒,針對智能對話場景中的用戶文本,自動判斷該文本的情緒類別并給出相應的置信度,情緒類型分為積極、消極、中性。

資源截圖

代碼片段和文件信息

#???Copyright?(c)?2019?PaddlePaddle?Authors.?All?Rights?Reserved.
#
#?Licensed?under?the?Apache?License?Version?2.0?(the?“License“);
#?you?may?not?use?this?file?except?in?compliance?with?the?License.
#?You?may?obtain?a?copy?of?the?License?at
#
#?????http://www.apache.org/licenses/LICENSE-2.0
#
#?Unless?required?by?applicable?law?or?agreed?to?in?writing?software
#?distributed?under?the?License?is?distributed?on?an?“AS?IS“?BASIS
#?WITHOUT?WARRANTIES?OR?CONDITIONS?OF?ANY?KIND?either?express?or?implied.
#?See?the?License?for?the?specific?language?governing?permissions?and
#?limitations?under?the?License.
“““Mask?padding?and?batching.“““

from?__future__?import?absolute_import
from?__future__?import?division
from?__future__?import?print_function

import?numpy?as?np


def?mask(batch_tokens?total_token_num?vocab_size?CLS=1?SEP=2?MASK=3):
????“““
????Add?mask?for?batch_tokens?return?out?mask_label?mask_pos;
????Note:?mask_pos?responding?the?batch_tokens?after?padded;
????“““
????max_len?=?max([len(sent)?for?sent?in?batch_tokens])
????mask_label?=?[]
????mask_pos?=?[]
????prob_mask?=?np.random.rand(total_token_num)
????#?Note:?the?first?token?is?[CLS]?so?[low=1]
????replace_ids?=?np.random.randint(1?high=vocab_size?size=total_token_num)
????pre_sent_len?=?0
????prob_index?=?0
????for?sent_index?sent?in?enumerate(batch_tokens):
????????mask_flag?=?False
????????prob_index?+=?pre_sent_len
????????for?token_index?token?in?enumerate(sent):
????????????prob?=?prob_mask[prob_index?+?token_index]
????????????if?prob?>?0.15:
????????????????continue
????????????elif?0.03?????????????????#?mask
????????????????if?token?!=?SEP?and?token?!=?CLS:
????????????????????mask_label.append(sent[token_index])
????????????????????sent[token_index]?=?MASK
????????????????????mask_flag?=?True
????????????????????mask_pos.append(sent_index?*?max_len?+?token_index)
????????????elif?0.015?????????????????#?random?replace
????????????????if?token?!=?SEP?and?token?!=?CLS:
????????????????????mask_label.append(sent[token_index])
????????????????????sent[token_index]?=?replace_ids[prob_index?+?token_index]
????????????????????mask_flag?=?True
????????????????????mask_pos.append(sent_index?*?max_len?+?token_index)
????????????else:
????????????????#?keep?the?original?token
????????????????if?token?!=?SEP?and?token?!=?CLS:
????????????????????mask_label.append(sent[token_index])
????????????????????mask_pos.append(sent_index?*?max_len?+?token_index)
????????pre_sent_len?=?len(sent)

????????#?ensure?at?least?mask?one?word?in?a?sentence
????????while?not?mask_flag:
????????????token_index?=?int(np.random.randint(1?high=len(sent)?-?1?size=1))
????????????if?sent[token_index]?!=?SEP?and?sent[token_index]?!=?CLS:
????????????????mask_label.append(sent[token_index])
????????????????sent[token_index]?=?MASK
????????????????mask_flag?=?True
????????????????mask_pos.append(sent_index?*?max_len?+?token_index)
????mask_label?=?np.array(mask_lab

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2020-03-13?12:53??models-1.7.0\
?????文件?????????859??2020-03-13?12:53??models-1.7.0\.clang-format
?????文件?????????361??2020-03-13?12:53??models-1.7.0\.clang_format.hook
?????文件??????????47??2020-03-13?12:53??models-1.7.0\.gitignore
?????文件?????????795??2020-03-13?12:53??models-1.7.0\.gitmodules
?????文件????????1017??2020-03-13?12:53??models-1.7.0\.pre-commit-config.yaml
?????文件??????????48??2020-03-13?12:53??models-1.7.0\.style.yapf
?????文件?????????840??2020-03-13?12:53??models-1.7.0\.travis.yml
?????目錄???????????0??2020-03-13?12:53??models-1.7.0\.travis\
?????文件?????????351??2020-03-13?12:53??models-1.7.0\.travis\precommit.sh
?????文件?????????957??2020-03-13?12:53??models-1.7.0\.travis\unittest.sh
?????文件???????11437??2020-03-13?12:53??models-1.7.0\LICENSE
?????目錄???????????0??2020-03-13?12:53??models-1.7.0\PaddleCV\
?????目錄???????????0??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\
?????目錄???????????0??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\
?????文件?????????151??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\.gitignore
?????文件????????8021??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\README.md
?????文件????????8568??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\README_en.md
?????目錄???????????0??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\data\
?????文件?????????800??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\data\__init__.py
?????文件????????4138??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\data\data_utils.py
?????文件????????4298??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\data\indoor3d_reader.py
?????文件????????4074??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\data\modelnet40_reader.py
?????目錄???????????0??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\dataset\
?????目錄???????????0??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\dataset\Indoor3DSemSeg\
?????文件?????????299??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\dataset\Indoor3DSemSeg\download.sh
?????目錄???????????0??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\dataset\ModelNet40\
?????文件?????????291??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\dataset\ModelNet40\download.sh
?????文件????????4920??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\eval_cls.py
?????文件????????4885??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\eval_seg.py
?????目錄???????????0??2020-03-13?12:53??models-1.7.0\PaddleCV\3d_vision\PointNet++\ext_op\
............此處省略1975個文件信息

評論

共有 條評論