Exemplo n.º 1
0
def init_config():
    json_object = json.load(open("config.json"))

    config = Config(json_object["dataset_dir"], json_object["dump_location"], json_object["tweet_keys_file"],
                    int(json_object["num_process"]))

    data_choices = json_object["data_collection_choice"]
    data_features_to_collect = json_object["data_features_to_collect"]

    return config, data_choices, data_features_to_collect
Exemplo n.º 2
0
def init_config():

    # read config file
    json_object = json.load(open("config.json"))

    # save attributes of config into object
    config = Config(json_object["dataset_dir"], json_object["dump_location"],
                    json_object["tweet_keys_file"],
                    int(json_object["num_process"]),
                    int(json_object["cascade_time_limitation"]))

    # list of object, e.g. [{"news_source": "politifact", "label": "fake"}, ... ]
    data_choices = json_object["data_collection_choice"]

    # list of string, e.g. ["news_articles", "tweets", "retweets", "user_profile", "user_timeline_tweets", "user_followers", "user_following"]
    data_features_to_collect = json_object["data_features_to_collect"]

    return config, data_choices, data_features_to_collect