pierreguillou commited on
Commit
1f9a729
·
verified ·
1 Parent(s): 00654a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -10
app.py CHANGED
@@ -114,16 +114,11 @@ def initialize_gemini():
114
  except Exception as e:
115
  raise gr.Error(f"Error initializing Gemini: {str(e)}")
116
 
117
- def create_prompt(extracted_text: str) -> str:
118
- data_to_extract = {
119
- "tribunal": "",
120
- "numero_rg": "",
121
- "date_ordonnance": "",
122
- "demandeurs": [],
123
- "defendeurs": [],
124
- "avocats_demandeurs": [],
125
- "avocats_defendeurs": []
126
- }
127
 
128
  prompt = f"""Tu es un assistant juridique expert en analyse de documents judiciaires français.
129
  Je vais te fournir le contenu d'un document judiciaire extrait d'un PDF.
 
114
  except Exception as e:
115
  raise gr.Error(f"Error initializing Gemini: {str(e)}")
116
 
117
+ def create_prompt(extracted_text: str, path_to_data_to_extract: str) -> str:
118
+
119
+ # load data to extract
120
+ with open(path_to_data_to_extract, 'r', encoding='utf-8') as file:
121
+ data_to_extract = json.load(file)
 
 
 
 
 
122
 
123
  prompt = f"""Tu es un assistant juridique expert en analyse de documents judiciaires français.
124
  Je vais te fournir le contenu d'un document judiciaire extrait d'un PDF.