• 大小: 304KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-01-02
  • 语言: ASP
  • 标签: 论文代码  

资源简介

Attention-based LSTM for Aspect-level Sentiment Classification 论文代码 作者: Yequan Wang Minlie Huang Li Zhao Xiaoyan ZHu

资源截图

代码片段和文件信息

import numpy as np
import theano

class Sentence(object):
    “““docstring for sentence“““
    def __init__(self content target rating grained):
        self.content self.target = content.lower() target
        self.solution = np.zeros(grained dtype=theano.config.floatX)
        self.senlength = len(self.content.split(‘ ‘))
        try:
            self.solution[int(rating)+1] = 1
        except:
            exit()
    def stat(self target_dict wordlist grained=3):
        data data_target i = [] [] 0
        solution = np.zeros((self.senlength grained) dtype=theano.config.floatX)
        for word in self.content.split(‘ ‘):
            data.append(wordlist[word])
            try:
                pol = Lexicons_dict[word]
                solution[i][pol+

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      48547  2016-05-25 09:53  atae-lstm\data\dev.cor

     文件     525789  2016-12-13 10:19  atae-lstm\data\glove.840B.300d.txt

     文件      93315  2016-05-25 09:52  atae-lstm\data\test.cor

     文件     278874  2016-05-25 09:53  atae-lstm\data\train.cor

     文件       4166  2016-12-13 10:13  atae-lstm\DataManager.py

     文件       3241  2016-12-13 10:13  atae-lstm\Evaluator.py

     文件       6977  2016-12-13 10:21  atae-lstm\lstm_att_con.py

     文件       4412  2016-12-13 10:22  atae-lstm\main.py

     文件        989  2016-12-05 10:41  atae-lstm\Optimizer.py

     文件        318  2016-12-13 10:31  atae-lstm\ReadME.md

     文件       1760  2016-12-13 10:15  atae-lstm\WordLoader.py

     目录          0  2016-12-13 10:18  atae-lstm\data

     目录          0  2016-12-13 10:05  atae-lstm\result

     目录          0  2016-12-13 10:24  atae-lstm

----------- ---------  ---------- -----  ----

               968388                    14


评论

共有 条评论

相关资源