yulongchen commited on
Commit
19c9345
·
1 Parent(s): 95d7c79

Add system

Browse files
Files changed (1) hide show
  1. system/ee.py +8 -2
system/ee.py CHANGED
@@ -4,6 +4,7 @@ import argparse
4
  from tqdm import tqdm
5
  import tiktoken
6
  from openai import OpenAI
 
7
 
8
  def gpt_4o(input_text):
9
  client=OpenAI(api_key=os.environ.get("OAI"))
@@ -21,12 +22,17 @@ def gpt_4o(input_text):
21
  )
22
  return response.choices[0].message.content
23
 
24
- def run_gpt4_event_extraction(data_dir, icl_path, max_tokens=100000):
25
 
26
  all_info_path = os.path.join(data_dir, "all_info_with_txt.json")
27
  output_dir = os.path.join(data_dir, "gpt4_event_extraction")
28
  os.makedirs(output_dir, exist_ok=True)
29
-
 
 
 
 
 
30
  ICL = open(icl_path, "r").read()
31
  all_info = open(all_info_path, "r").readlines()
32
 
 
4
  from tqdm import tqdm
5
  import tiktoken
6
  from openai import OpenAI
7
+ from huggingface_hub import hf_hub_download
8
 
9
  def gpt_4o(input_text):
10
  client=OpenAI(api_key=os.environ.get("OAI"))
 
22
  )
23
  return response.choices[0].message.content
24
 
25
+ def run_gpt4_event_extraction(data_dir, max_tokens=100000):
26
 
27
  all_info_path = os.path.join(data_dir, "all_info_with_txt.json")
28
  output_dir = os.path.join(data_dir, "gpt4_event_extraction")
29
  os.makedirs(output_dir, exist_ok=True)
30
+ icl_path = hf_hub_download(
31
+ repo_id="PledgeTracker/demo_feedback",
32
+ filename="icl.txt",
33
+ repo_type="dataset",
34
+ token=os.environ["HF_TOKEN"]
35
+ )
36
  ICL = open(icl_path, "r").read()
37
  all_info = open(all_info_path, "r").readlines()
38