Skip to content

Commit d9801e0

Browse files
remove commented code
1 parent 3a95ad9 commit d9801e0

File tree

2 files changed

+0
-79
lines changed

2 files changed

+0
-79
lines changed

infra/scripts/index_scripts/04_cu_process_data_new_data.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
from datetime import datetime, timedelta
1212
import time
13-
import base64
1413
import pyodbc
1514
import struct
1615

@@ -121,9 +120,6 @@ def chunk_data(text):
121120

122121
search_client = SearchClient(search_endpoint, index_name, search_credential)
123122

124-
# # delete all the documents in the index
125-
# search_client.delete_documents(search_client.search("*"))
126-
127123
index_client = SearchIndexClient(endpoint=search_endpoint, credential=search_credential)
128124

129125
# Delete the search index
@@ -401,10 +397,6 @@ def prepare_search_doc(content, document_id):
401397
cursor.execute(f"INSERT INTO processed_data (ConversationId, EndTime, StartTime, Content, summary, satisfied, sentiment, topic, key_phrases, complaint) VALUES (?,?,?,?,?,?,?,?,?,?)", (conversation_id, end_timestamp, start_timestamp, content, summary, satisfied, sentiment, topic, key_phrases, complaint))
402398
conn.commit()
403399

404-
# keyPhrases = key_phrases.split(',')
405-
# for keyPhrase in keyPhrases:
406-
# cursor.execute(f"INSERT INTO processed_data_key_phrases (ConversationId, key_phrase, sentiment) VALUES (?,?,?)", (conversation_id, keyPhrase, sentiment))
407-
408400
document_id = conversation_id
409401

410402
result = prepare_search_doc(content, document_id)
@@ -471,16 +463,6 @@ def call_gpt4(topics_str1, client):
471463
Return the topics and their labels in JSON format.Always add 'topics' node and 'label', 'description' attributes in json.
472464
Do not return anything else.
473465
"""
474-
# Phi-3 model client
475-
# response = client.complete(
476-
# messages=[
477-
# # SystemMessage(content=prompt),
478-
# UserMessage(content=topic_prompt),
479-
# ],
480-
# max_tokens = 1000,
481-
# temperature = 0,
482-
# top_p = 1
483-
# )
484466

485467
# GPT-4o model client
486468
response = client.chat.completions.create(
@@ -588,17 +570,6 @@ def get_mined_topic_mapping(input_text, list_of_topics):
588570
from a list of topics - {list_of_topics}.
589571
ALWAYS only return a topic from list - {list_of_topics}. Do not add any other text.'''
590572

591-
# Phi-3 model client
592-
# response = client.complete(
593-
# messages=[
594-
# # SystemMessage(content=prompt),
595-
# UserMessage(content=prompt),
596-
# ],
597-
# max_tokens = 500,
598-
# temperature = 0,
599-
# top_p = 1
600-
# )
601-
602573
# GPT-4o model client
603574
response = client.chat.completions.create(
604575
model=deployment,
@@ -669,28 +640,8 @@ def get_mined_topic_mapping(input_text, list_of_topics):
669640
# Bulk insert using executemany()
670641
cursor.executemany(insert_sql, data_list)
671642

672-
# column_names = [i[0] for i in cursor.description]
673-
# df = pd.DataFrame(rows, columns=column_names)
674-
# for idx, row in df.iterrows():
675-
# cursor.execute(f"INSERT INTO km_processed_data (ConversationId, StartTime, EndTime, Content, summary, satisfied, sentiment, keyphrases, complaint, topic) VALUES (?,?,?,?,?,?,?,?,?,?)", (row['ConversationId'], row['StartTime'], row['EndTime'], row['Content'], row['summary'], row['satisfied'], row['sentiment'], row['keyphrases'], row['complaint'], row['topic']))
676643
conn.commit()
677644

678-
# update keyphrase table after the data update
679-
# cursor.execute('DROP TABLE IF EXISTS processed_data_key_phrases')
680-
# conn.commit()
681-
# print("Dropped processed_data_key_phrases table")
682-
683-
# create_processed_data_sql = """CREATE TABLE processed_data_key_phrases (
684-
# ConversationId varchar(255),
685-
# key_phrase varchar(500),
686-
# sentiment varchar(255),
687-
# topic varchar(255),
688-
# StartTime varchar(255),
689-
# );"""
690-
# cursor.execute(create_processed_data_sql)
691-
# conn.commit()
692-
# print('created processed_data_key_phrases table')
693-
694645
sql_stmt = '''select ConversationId, key_phrases, sentiment, mined_topic as topic, StartTime from processed_data'''
695646
cursor.execute(sql_stmt)
696647
rows = [tuple(row) for row in cursor.fetchall()]

infra/scripts/process_data_scripts.sh

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,11 @@ requirementFileUrl=${baseUrl}"infra/scripts/index_scripts/requirements.txt"
99

1010
echo "Script Started"
1111

12-
# Download the create_index and create table python files
13-
# curl --output "01_create_search_index.py" ${baseUrl}"infra/scripts/index_scripts/01_create_search_index.py"
14-
# curl --output "02_create_cu_template_text.py" ${baseUrl}"infra/scripts/index_scripts/02_create_cu_template_text.py"
15-
# curl --output "02_create_cu_template_audio.py" ${baseUrl}"infra/scripts/index_scripts/02_create_cu_template_audio.py"
16-
# curl --output "03_cu_process_data_text.py" ${baseUrl}"infra/scripts/index_scripts/03_cu_process_data_text.py"
1712
curl --output "04_cu_process_data_new_data.py" ${baseUrl}"infra/scripts/index_scripts/04_cu_process_data_new_data.py"
1813
curl --output "content_understanding_client.py" ${baseUrl}"infra/scripts/index_scripts/content_understanding_client.py"
1914
curl --output "ckm-analyzer_config_text.json" ${baseUrl}"infra/data/ckm-analyzer_config_text.json"
2015
curl --output "ckm-analyzer_config_audio.json" ${baseUrl}"infra/data/ckm-analyzer_config_audio.json"
2116

22-
# curl --output "sample_processed_data.json" ${baseUrl}"infra/data/sample_processed_data.json"
23-
# curl --output "sample_processed_data_key_phrases.json" ${baseUrl}"infra/data/sample_processed_data_key_phrases.json"
24-
# curl --output "sample_search_index_data.json" ${baseUrl}"infra/data/sample_search_index_data.json"
25-
26-
# RUN apt-get update
27-
# RUN apt-get install python3 python3-dev g++ unixodbc-dev unixodbc libpq-dev
28-
# apk add python3 python3-dev g++ unixodbc-dev unixodbc libpq-dev
29-
30-
# # RUN apt-get install python3 python3-dev g++ unixodbc-dev unixodbc libpq-dev
31-
# pip install pyodbc
32-
3317
############################################
3418
echo "Installing system packages..."
3519
apk add --no-cache --virtual .build-deps build-base unixodbc-dev
@@ -46,22 +30,8 @@ curl --output "$requirementFile" "$requirementFileUrl"
4630

4731
echo "Download completed"
4832

49-
#Replace key vault name
50-
# sed -i "s/kv_to-be-replaced/${keyvaultName}/g" "01_create_search_index.py"
51-
# sed -i "s/mici_to-be-replaced/${managedIdentityClientId}/g" "01_create_search_index.py"
52-
# sed -i "s/kv_to-be-replaced/${keyvaultName}/g" "02_create_cu_template_text.py"
53-
# sed -i "s/mici_to-be-replaced/${managedIdentityClientId}/g" "02_create_cu_template_text.py"
54-
# sed -i "s/kv_to-be-replaced/${keyvaultName}/g" "02_create_cu_template_audio.py"
55-
# sed -i "s/mici_to-be-replaced/${managedIdentityClientId}/g" "02_create_cu_template_audio.py"
56-
# sed -i "s/kv_to-be-replaced/${keyvaultName}/g" "03_cu_process_data_text.py"
57-
# sed -i "s/mici_to-be-replaced/${managedIdentityClientId}/g" "03_cu_process_data_text.py"
58-
5933
sed -i "s/kv_to-be-replaced/${keyvaultName}/g" "04_cu_process_data_new_data.py"
6034

6135
pip install -r requirements.txt
6236

63-
# python 01_create_search_index.py
64-
# python 02_create_cu_template_text.py
65-
# python 02_create_cu_template_audio.py
66-
# python 03_cu_process_data_text.py
6737
python 04_cu_process_data_new_data.py

0 commit comments

Comments
 (0)