Spaces:
Sleeping
Sleeping
Atharva Chauthaiwale
commited on
Commit
·
d0410c0
1
Parent(s):
e5aa754
Gradio app summary
Browse files- interpret_judgement.py +7 -0
interpret_judgement.py
CHANGED
@@ -5,6 +5,7 @@ import logging
|
|
5 |
import sys
|
6 |
import os.path
|
7 |
import requests
|
|
|
8 |
|
9 |
Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-base-en-v1.5")
|
10 |
Settings.llm = HuggingFaceInferenceAPI(
|
@@ -43,3 +44,9 @@ def interpret_judgement(case_url, file_name='test', title=''):
|
|
43 |
query_engine = index.as_query_engine()
|
44 |
return query_engine.query(f'''Intepret and simplify the judegement {title} from given context. Convert it into a 3-4 line NEWS story format.
|
45 |
It should include information about petitioner, respondent and quick summary of order passed.''')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
import sys
|
6 |
import os.path
|
7 |
import requests
|
8 |
+
from simple_kv_store import SimpleKVStore
|
9 |
|
10 |
Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-base-en-v1.5")
|
11 |
Settings.llm = HuggingFaceInferenceAPI(
|
|
|
44 |
query_engine = index.as_query_engine()
|
45 |
return query_engine.query(f'''Intepret and simplify the judegement {title} from given context. Convert it into a 3-4 line NEWS story format.
|
46 |
It should include information about petitioner, respondent and quick summary of order passed.''')
|
47 |
+
|
48 |
+
def interpret_by_case_title(case_title):
|
49 |
+
diary_no = case_title.split('-')[0]
|
50 |
+
case_obj = SimpleKVStore.get(diary_no)
|
51 |
+
logging.info(f'Found case in gradio app kv store {case_obj}')
|
52 |
+
return interpret_judgement(case_obj['link'], diary_no, case_title)
|