-
Notifications
You must be signed in to change notification settings - Fork 5
/
config-template.yml
62 lines (55 loc) · 2.7 KB
/
config-template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Currently supported data source types are StreamingAPI, FlatFile
# StreamingAPI is the Twitter Streaming API
data_sources:
-
type: 'StreamingAPI' # Required
alias: 'Twitter Streaming API' # Required
api_key: 'XXXXXXXXXXXXXXXXXXXXXXXX' # Required
api_secret: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' # Required
access_token: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' # Required
access_token_secret: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' # Required
auto_restart: True # Optional
projection: # Optional (this will restrict the JSON attributes returned from the streamed tweets, helpful for bandwidth optimization and simplification). All attributes must be present in the JSON object, or it will be dropped here in the pipeline.
- 'text'
- 'created_at'
- 'lang'
outputs: # Required (at least one entry)
- 'Streaming Sentiment Classifier'
-
type: 'FlatFile' # Required
alias: 'Raw Tweets JSON File' # Required
filename: 'examples/sentiment-analysis/data/raw_tweets.json' # Required (Can be either the full path, or path relative to the config file you pass to main.py)
outputs: # Required (at least one entry)
- 'Flat File Sentiment Classifier'
# All models must be custom, no built-in models currently supported
models:
-
alias: 'Flat File Sentiment Classifier' # Required
module_file_path: 'examples/sentiment-analysis/sentiment.py' # Required (Can be either the full path, or path relative to the config file you pass to main.py)
module_classname: 'SentimentClassifier' # Required
method_name: 'predict' # Required, method name on the class instance
input_attribute: 'fasdf' # Optional, depending on data type
output_attribute: 'sentiment_score' # Optional, useful for JSON
preprocessor: 'Tweet Preprocessor' # Optional
outputs: # Required (at least one entry)
- 'Twitter Sentiment Predictions File'
- 'IO'
# Current storage types supported: File, IO
storage:
-
type: 'File' # Required
alias: 'Twitter Sentiment Predictions File' # Required
save_filename: 'sentiment_predictions.json' # Required
-
type: 'IO' # Required
alias: 'stdout' # Required
# Preprocessors are custom, but feel free to use and modify the tweet preprocessor in the sentiment analysis example
preprocessors:
-
alias: 'Tweet Preprocessor' # Required
module_file_path: 'examples/sentiment-analysis/tweet_preprocessor.py' # Required
module_classname: 'TweetPreprocessor' # Required
method_name: 'preprocess' # Required
# Connection information for the RabbitMQ instance (Currently only host name supported)
messaging:
host: 'localhost' # Required