| | import configparser
|
| | import json
|
| | def get_config():
|
| |
|
| | config = configparser.ConfigParser()
|
| | config.read(r"C:\Users\kbuzlu\PycharmProjects\SentimentIntentionAnalysis\config\config.ini")
|
| |
|
| |
|
| | model_name = config["model"]["name"]
|
| |
|
| |
|
| | data_path = config["data"]["data_dir"]
|
| |
|
| |
|
| | labels_path = config["data"]["possible_labels_dir"]
|
| | return model_name, data_path, labels_path
|
| |
|
| | def load_data(data_path):
|
| |
|
| | with open(data_path, "r") as file:
|
| | data = json.load(file)
|
| | texts = [entry["text"] for entry in data]
|
| | return texts
|
| |
|
| | def load_labels(labels_path):
|
| |
|
| | with open(labels_path, "r") as file:
|
| | data = json.load(file)
|
| | sentiment_labels = data["sentiment_labels"]
|
| | intention_labels = data["intention_labels"]
|
| | return sentiment_labels, intention_labels |