brand-sentiment-analysis

所属分类:自然语言处理
开发工具:CSS
文件大小:2116KB
下载次数:0
上传日期:2022-07-06 20:10:47
上 传 者sh-1993
说明:  品牌情绪分析,脚本利用Heartex平台从新闻中构建品牌情绪分析
(brand-sentiment-analysis,Scripts utilizing Heartex platform to build brand sentiment analysis from the news)

文件列表:
LICENSE (11357, 2019-07-24)
demo.png (182682, 2019-07-24)
requirements.txt (121, 2019-07-24)
src (0, 2019-07-24)
src\config.json (995, 2019-07-24)
src\heartex (0, 2019-07-24)
src\heartex\__init__.py (17, 2019-07-24)
src\heartex\add_sentiment_chart.py (2921, 2019-07-24)
src\heartex\api.py (2223, 2019-07-24)
src\heartex\create_filter_project.py (1013, 2019-07-24)
src\heartex\create_sentiment_project.py (886, 2019-07-24)
src\heartex\predict_and_filter.py (1800, 2019-07-24)
src\service.py (8423, 2019-07-24)
src\static (0, 2019-07-24)
src\static\data (0, 2019-07-24)
src\static\data\output.json (429367, 2019-07-24)
src\static\favicon.ico (21822, 2019-07-24)
src\static\js (0, 2019-07-24)
src\static\js\Chart.bundle.min.js (209055, 2019-07-24)
src\static\js\Chart.plots.js (3099, 2019-07-24)
src\static\js\DateFormat.js (4017, 2019-07-24)
src\static\js\jquery-3.3.1.min.js (86927, 2019-07-24)
src\static\js\vue.js (93675, 2019-07-24)
src\static\logs (0, 2019-07-24)
src\static\semantic-ui (0, 2019-07-24)
src\static\semantic-ui\semantic.css (828900, 2019-07-24)
src\static\semantic-ui\semantic.js (736574, 2019-07-24)
src\static\semantic-ui\semantic.min.css (628512, 2019-07-24)
src\static\semantic-ui\semantic.min.js (275730, 2019-07-24)
src\static\semantic-ui\themes (0, 2019-07-24)
src\static\semantic-ui\themes\default (0, 2019-07-24)
src\static\semantic-ui\themes\default\assets (0, 2019-07-24)
src\static\semantic-ui\themes\default\assets\fonts (0, 2019-07-24)
src\static\semantic-ui\themes\default\assets\fonts\brand-icons.eot (129648, 2019-07-24)
src\static\semantic-ui\themes\default\assets\fonts\brand-icons.svg (691865, 2019-07-24)
src\static\semantic-ui\themes\default\assets\fonts\brand-icons.ttf (129344, 2019-07-24)
src\static\semantic-ui\themes\default\assets\fonts\brand-icons.woff (87544, 2019-07-24)
... ...

# Brand Sentiment A set of scripts that makes sentiment analysis of your brand based on Google News and Twitter news streams. It utilizes Heartex platform to create a custom neural network to do the study specifically for your brand [Tutorial](https://heartex.net/use-case/sentiment) ![](https://github.com/heartexlabs/brand-sentiment-analysis/raw/master/demo.png) # Installation > Important. To make it work you need to obtain **Heartex token**, to do so [signup here](https://go.heartex.net/business/signup/?ref=github). We give you a free account with 10k API requests (with above link only!). ```sh # install python3 -m venv bsa-env source bsa-env/bin/active pip install -r requirements ``` ```sh # configure export TOKEN="" export BRAND="" ``` # Create Sentiment Model ```sh # first we need to grab news data python src/get_google_news.py --pages=10 --query=$BRAND --output=news.csv ``` ```sh # create project on heartex python src/create_sentiment_project.py --token=$TOKEN --input=news.csv # you will get project id, save it here export SENTIMENT_PROJECT_ID="" ``` Open up `src/config.json` and put **$TOKEN** and **$SENTIMENT_PROJECT_ID** there # Run Execute ``` python3 service.py config.json``` # Add your own data > [TBD] # Advanced: Filter Results In case your brand may appear in different contexts, for example, with the name of one of your products (ex: Apple Watch), you may want to filter those occurrences first. To do that we will use another type of model which is called a tagger model. It learns when you tag relevant occurrences. ```sh PRODUCTS="Apple,iOS,iPadOS,watchOS,macOS,MacPro,Pro Display" ``` ```sh # create Heartex project to filter news that are only relevent to your brand name # you will get back a link where you need to train a neural network a little bit to make it understand what is relevent to you python src/create_filter_project.py --token=$TOKEN --input=news.csv --labels=$PRODUCTS # set project here export FILTER_PROJECT="" ``` Now you have what is called a smart filter, edit config.json and include it there. You will see smart filter buttons on the index page.

近期下载者

相关文件


收藏者