Spaces:
Sleeping
Sleeping
Commit ·
d210108
1
Parent(s): 8dca04f
Add system
Browse filesFiles changed (3)
182 unmodified lines183184185186187188189190191192193182 unmodified lines with open(default_log_path, "w") as f: f.write(json.dumps(log_entry, indent=1))
default_tsv_path = f"{FEEDBACK_DIR}/augmented_{timestamp}_{user_id}.tsv" tsv_path = outputs["sorted_events"] df = pd.read_excel(tsv_path) df.to_csv(default_tsv_path, sep='\t', index=False)
try: api = HfApi() api.upload_file(44 unmodified lines4546474848495051525253545544 unmodified lines raise ValueError(f"[ERROR] Unsafe path: {dir_path}") dir_path.mkdir(parents=True, exist_ok=True)
def run_augmented_searching(qa_file, pipeline_base_dir, suggestion_meta, pledge_author, start_date, end_date):def run_augmented_searching(qa_file, pipeline_base_dir, suggestion_meta, pledge_author, pledge_date, start_date, end_date): if suggestion_meta==None: qa_lines = open(f"{qa_file}","r").read() qa_lines = json.loads(qa_lines) claim_text = f"{pledge_author}: {qa_lines['claim']}" claim_text = f"{pledge_author}: {qa_lines['claim']} ({pledge_date})" idx=0 else: # claim_text = suggestion_meta["text"]45 unmodified lines464748494950515270 unmodified lines12312412512612712812945 unmodified lines
print("🔍 Step 1: Initial searching ...") initial_tsv_file, claim_json_path = run_initial_searching( claim_text=f"{pledge_author} : {claim}", claim_text=f"{pledge_author} : {claim} ({pledge_date})", # pledge_author=pledge_author, pipeline_base_dir=pipeline_base_dir, start_date=start_date,70 unmodified lines augmented_tsv_file = run_augmented_searching( qa_file=qa_file_path, pledge_author=pledge_author, pledge_date=pledge_date, pipeline_base_dir=pipeline_base_dir, start_date=start_date, suggestion_meta=suggestion_meta,app.py+5
system/augmented_searching.py+2-2
system/pledge_tracking.py+2-1