template-scala-rnn:RNN算法实现

  • X6_603614
    了解作者
  • 16.1KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-24 05:42
    上传日期
模板说明。 该模板提供情感分析算法 。 安装。 遵循。 安装后启动所有 PredictionIO 供应商并检查 pio 状态: pio-start-all pio status 将此模板复制到您的本地目录: pio template get ts335793/template-scala-spark-dl4j-word2vec-rnn < TemplateName> 下载并将其放在<TemplateDirectory>/src/main/resources/ 。 导入训练数据。 您可以从导入示例训练数据。 它是带有情感标签的烂番茄电影评论的集合。 为了使用这些数据,创建新的应用程序: pio app new < ApplicationName> # prints out ApplicationAccessKey 将 engine.json 中的 appName 设
template-scala-rnn-master.zip
内容介绍
# Template description. This template provides sentiment analysis algorithm [RNN](http://nlp.stanford.edu/~socherr/EMNLP2013_RNTN.pdf). # Installation. Follow [installation guide for PredictionIO](http://docs.prediction.io/install/). After installation start all PredictionIO vendors and check pio status: ```bash pio-start-all pio status ``` Copy this template to your local directory with: ```bash pio template get ts335793/template-scala-spark-dl4j-word2vec-rnn <TemplateName> ``` Download [en-parser-chunking.bin](http://opennlp.sourceforge.net/models-1.5/en-parser-chunking.bin) and place it in `<TemplateDirectory>/src/main/resources/`. # Importing training data. You can import example training data from [kaggle](https://www.kaggle.com/c/sentiment-analysis-on-movie-reviews/data). It is collection of the Rotten Tomatoes movie reviews with sentiment labels. In order to use this data, create new app: ```bash pio app new <applicationName rel='nofollow' onclick='return false;'> # prints out ApplicationAccessKey ``` set appName in engine.json to ApplicationName and import data with: ```bash python data/import_eventserver.py --access_key <applicationAccessKey rel='nofollow' onclick='return false;'> --file train.tsv ``` You can always remind your application id and key with: ```bash pio app list ``` # Build, train, deploy. You might build template, train it and deploy by typing: ```bash pio build pio train pio deploy ``` # Sending requests to server. In order to send a query run in template directory: ```bash python data/send_query_interactive.py ``` and type phrase you want sentiment to be predicted. The result will be predicted sentiment for the phrase.
评论
    相关推荐