Skip to content

Commit faed2af

Browse files
committed
incl keyword, sentiment code
1 parent a9b416a commit faed2af

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

psl_proof/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def load_config() -> Dict[str, Any]:
1919
'input_dir': INPUT_DIR,
2020
'salt': '5EkntCWI',
2121
# 'validator_base_api_url': 'https://api.vana.genesis.dfusion.ai'
22-
'validator_base_api_url': 'https://c1dc39337276.ngrok-free.app'
22+
'validator_base_api_url': 'https://1bf072acbe7c.ngrok-free.app'
2323
}
2424
logging.info(f"Using config: {json.dumps(config, indent=2)}")
2525
return config

psl_proof/utils/validate_data.py

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from typing import List, Dict, Any
88

99
from psl_proof.models.submission_dtos import ChatHistory, SubmissionChat, ChatHistory, SubmissionHistory
10-
#from psl_proof.utils.feature_extraction import get_keywords_keybert, get_sentiment_data
10+
from psl_proof.utils.feature_extraction import get_keywords_keybert, get_sentiment_data
1111

1212
def get_total_score(quality, uniqueness)-> float:
1313
#total_score = quality # Since uniqueness always 1
@@ -141,21 +141,24 @@ def validate_data(
141141
#print(f"source_contents: {source_contents}")
142142

143143
# disable on 27/03/2025
144-
# chat_sentiment = get_sentiment_data(
145-
# source_contents
146-
# )
147-
# chat_keywords = get_keywords_keybert(
148-
# source_contents
149-
# )
150-
151-
# chat_data = ChatData(
152-
# chat_length=contents_length,
153-
# chat_start_on = source_chat.chat_start_on,
154-
# chat_ended_on = source_chat.chat_ended_on,
155-
# sentiment = chat_sentiment,
156-
# keywords = chat_keywords
157-
# )
158-
# #print(f"chat_data: {chat_data}")
159-
# cargo_data.chat_list.append(
160-
# chat_data
161-
# )
144+
chat_sentiment = get_sentiment_data(
145+
source_contents
146+
)
147+
chat_keywords = get_keywords_keybert(
148+
source_contents
149+
)
150+
151+
print(f"chat_sentiment: {chat_sentiment}")
152+
print(f"chat_keywords: {chat_keywords}")
153+
154+
chat_data = ChatData(
155+
chat_length=contents_length,
156+
chat_start_on = source_chat.chat_start_on,
157+
chat_ended_on = source_chat.chat_ended_on,
158+
# sentiment = chat_sentiment,
159+
# keywords = chat_keywords
160+
)
161+
#print(f"chat_data: {chat_data}")
162+
cargo_data.chat_list.append(
163+
chat_data
164+
)

0 commit comments

Comments
 (0)