Spaces:
Sleeping
Sleeping
samlonka
commited on
Commit
·
84bf07e
1
Parent(s):
418740e
''
Browse files
Tools.py
CHANGED
@@ -5,7 +5,7 @@ import streamlit as st
|
|
5 |
import pymysql
|
6 |
import ast
|
7 |
import re
|
8 |
-
from utils import word_sentence_similarity,
|
9 |
from llama_index.core.tools.tool_spec.base import BaseToolSpec
|
10 |
from database import execute_query
|
11 |
import pandas as pd
|
|
|
5 |
import pymysql
|
6 |
import ast
|
7 |
import re
|
8 |
+
from utils import word_sentence_similarity, get_list_meaning_word, get_details_mantra_json, iast_process
|
9 |
from llama_index.core.tools.tool_spec.base import BaseToolSpec
|
10 |
from database import execute_query
|
11 |
import pandas as pd
|
utils.py
CHANGED
@@ -113,8 +113,13 @@ def extract_meaning_by_language(data_list, target_language='English'):
|
|
113 |
#mantra_json_details
|
114 |
def get_details_mantra_json(query):
|
115 |
description, data = execute_query(query)
|
|
|
116 |
df = pd.DataFrame(data)
|
117 |
df.columns = [x[0] for x in description]
|
118 |
mantra_json = df['mantra_json'].values[0]
|
119 |
cleaned_data = re.sub('<[^<]+?>', '', mantra_json)
|
120 |
-
return json.loads(cleaned_data)
|
|
|
|
|
|
|
|
|
|
113 |
#mantra_json_details
|
114 |
def get_details_mantra_json(query):
|
115 |
description, data = execute_query(query)
|
116 |
+
print(data)
|
117 |
df = pd.DataFrame(data)
|
118 |
df.columns = [x[0] for x in description]
|
119 |
mantra_json = df['mantra_json'].values[0]
|
120 |
cleaned_data = re.sub('<[^<]+?>', '', mantra_json)
|
121 |
+
return json.loads(cleaned_data)
|
122 |
+
|
123 |
+
def iast_process(input_text):
|
124 |
+
output_text = re.sub('[\u0951-\u0954,\u200d,\u0331]', '', input_text)
|
125 |
+
return output_text
|