我有一些文本数据,每个文档都有多个标签.我想使用Theano为此数据集训练LSTM网络.我遇到了http://deeplearning.net/tutorial/lstm.html但它只是促进了二进制分类任务.如果有人对继续采用哪种方法有任何建议,那就太棒了.我只需要一个初步的可行方向,我可以继续努力.
谢谢,阿米特
我已经在3台机器上安装了celery + rabbitmq.我还创建了一个任务,它根据文件中的数据生成正则表达式,并使用该信息来解析文本.
from celery import Celery
celery = Celery('tasks', broker='amqp://localhost//')
import re
@celery.task
def add(x, y):
return x + y
def get_regular_expression():
with open("text") as fp:
data = fp.readlines()
str_re = "|".join([x.split()[2] for x in data ])
return str_re
@celery.task
def analyse_json(tw):
str_re = get_regular_expression()
re.match(str_re,tw.text)
Run Code Online (Sandbox Code Playgroud)
我可以使用以下python代码轻松调用此任务: -
from tasks import analyse_tweet_json
x = tweet ## load from a file (x is a json)
analyse_tweet_json.delay(x)
Run Code Online (Sandbox Code Playgroud)
但是,现在我想从Java而不是python进行相同的调用.我不确定做同样事情的最简单方法是什么.
我已经编写了这段代码,用于向AMQP代理发送消息.代码运行正常,但任务没有执行.我不知道如何指定应该执行的任务的名称.
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.Channel;
class try1 {
public …Run Code Online (Sandbox Code Playgroud)