fearlessbj4
commited on
Commit
•
960d377
1
Parent(s):
42c70ab
Upload /sim_case_sug_demo/g_h.py with huggingface_hub
Browse files- sim_case_sug_demo/g_h.py +14 -3
sim_case_sug_demo/g_h.py
CHANGED
@@ -741,6 +741,7 @@ elif sug_type=="dispute":
|
|
741 |
corpus_dict[fid]=[sen_lst[i]]
|
742 |
else:
|
743 |
corpus_dict[fid].append(sen_lst[i])
|
|
|
744 |
corpus_pd_f=json.load(open("./src/corpus3835_raw_dis.json","r"))["claim"]
|
745 |
else:
|
746 |
vec_f=json.load(open("./src/dispute_2022~2023_vec.json","r"))
|
@@ -756,9 +757,18 @@ elif sug_type=="dispute":
|
|
756 |
corpus_clust_label={_e:corpus_clust_f[_e[:_e.find("@")]][int(_e[_e.find("@")+1:])] for _e in id_lst}
|
757 |
|
758 |
|
|
|
|
|
|
|
759 |
|
760 |
-
|
761 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
762 |
###
|
763 |
|
764 |
|
@@ -793,7 +803,7 @@ import gradio as gr
|
|
793 |
|
794 |
def case_sug_dis(file_name,plaintiff,defendant,p_point,d_point,dispute_list):
|
795 |
global new_pd_f,new_point_f,corpus_dict
|
796 |
-
|
797 |
##print(file_name)
|
798 |
##print(point_f)
|
799 |
##print(list(pd_f.keys()).index(file_name))
|
@@ -836,6 +846,7 @@ def case_sug_dis(file_name,plaintiff,defendant,p_point,d_point,dispute_list):
|
|
836 |
def case_sug(file_name,plaintiff,p_point):
|
837 |
global new_pd_f,new_point_f,corpus_dict
|
838 |
|
|
|
839 |
#print(file_name)
|
840 |
##print(point_f)
|
841 |
##print(list(pd_f.keys()).index(file_name))
|
|
|
741 |
corpus_dict[fid]=[sen_lst[i]]
|
742 |
else:
|
743 |
corpus_dict[fid].append(sen_lst[i])
|
744 |
+
print(corpus_dict)
|
745 |
corpus_pd_f=json.load(open("./src/corpus3835_raw_dis.json","r"))["claim"]
|
746 |
else:
|
747 |
vec_f=json.load(open("./src/dispute_2022~2023_vec.json","r"))
|
|
|
757 |
corpus_clust_label={_e:corpus_clust_f[_e[:_e.find("@")]][int(_e[_e.find("@")+1:])] for _e in id_lst}
|
758 |
|
759 |
|
760 |
+
#if pool_type=="corpus3835":
|
761 |
+
o_new_point_f=lst_2_dict(jl("./src/gpt-4-turbo-0409-0.3.jsonl"))
|
762 |
+
o_new_pd_f=json.load(open("./src/new_3k3_corpus_raw.json","r"))["claim"]
|
763 |
|
764 |
+
|
765 |
+
#else:
|
766 |
+
n_new_point_f=lst_2_dict(jl("./src/gpt-4-turbo-0409-0.3-new22_23.jsonl"))
|
767 |
+
n_new_pd_f=json.load(open("./src/new22_23_3k3_corpus_raw.json","r"))["claim"]
|
768 |
+
|
769 |
+
|
770 |
+
new_point_f={**o_new_point_f,**n_new_point_f}
|
771 |
+
new_pd_f={**o_new_pd_f,**n_new_pd_f}
|
772 |
###
|
773 |
|
774 |
|
|
|
803 |
|
804 |
def case_sug_dis(file_name,plaintiff,defendant,p_point,d_point,dispute_list):
|
805 |
global new_pd_f,new_point_f,corpus_dict
|
806 |
+
file_name=file_name.replace("_",",")
|
807 |
##print(file_name)
|
808 |
##print(point_f)
|
809 |
##print(list(pd_f.keys()).index(file_name))
|
|
|
846 |
def case_sug(file_name,plaintiff,p_point):
|
847 |
global new_pd_f,new_point_f,corpus_dict
|
848 |
|
849 |
+
file_name=file_name.replace("_",",")
|
850 |
#print(file_name)
|
851 |
##print(point_f)
|
852 |
##print(list(pd_f.keys()).index(file_name))
|