research14 commited on
Commit
469b565
1 Parent(s): 31e54cb

commented out lftk function

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -16,26 +16,26 @@ llama_model = AutoModelForCausalLM.from_pretrained("daryl149/llama-2-7b-chat-hf"
16
 
17
  template_single = '''Please output any <{}> in the following sentence one per line without any additional text: "{}"'''
18
 
19
- def linguistic_features(message):
20
- # Load a trained spaCy pipeline
21
- nlp = spacy.load("en_core_web_sm")
22
 
23
- # Create a spaCy doc object
24
- doc = nlp(message)
25
 
26
- # Initiate LFTK extractor by passing in the doc
27
- LFTK_extractor = lftk.Extractor(docs=doc)
28
 
29
- # Customize LFTK extractor (optional)
30
- LFTK_extractor.customize(stop_words=True, punctuations=False, round_decimal=3)
31
 
32
- # Use LFTK to dynamically extract handcrafted linguistic features
33
- features_to_extract = lftk.search_features(family="wordsent", language="general", return_format="list_key")
34
- extracted_features = LFTK_extractor.extract(features=features_to_extract)
35
 
36
- print('Linguistic Features:', extracted_features)
37
 
38
- return extracted_features
39
 
40
 
41
  def update_api_key(new_key):
@@ -295,7 +295,7 @@ def interface():
295
  task_btn.click(llama_strategies_respond, inputs=[strategy3, task, task_linguistic_entities, task_prompt, llama_S3_chatbot],
296
  outputs=[task, task_prompt, llama_S3_chatbot])
297
 
298
- # Event Handler for GPT 3.5 Chatbot, user must submit api key before submitting the prompt
299
  # Will activate after getting API key
300
  # task_apikey_btn.click(update_api_key, inputs=ling_ents_apikey_input)
301
  # task_btn.click(gpt_strategies_respond, inputs=[strategy1, task, task_linguistic_entities, gpt_S1_chatbot],
 
16
 
17
  template_single = '''Please output any <{}> in the following sentence one per line without any additional text: "{}"'''
18
 
19
+ # def linguistic_features(message):
20
+ # # Load a trained spaCy pipeline
21
+ # nlp = spacy.load("en_core_web_sm")
22
 
23
+ # # Create a spaCy doc object
24
+ # doc = nlp(message)
25
 
26
+ # # Initiate LFTK extractor by passing in the doc
27
+ # LFTK_extractor = lftk.Extractor(docs=doc)
28
 
29
+ # # Customize LFTK extractor (optional)
30
+ # LFTK_extractor.customize(stop_words=True, punctuations=False, round_decimal=3)
31
 
32
+ # # Use LFTK to dynamically extract handcrafted linguistic features
33
+ # features_to_extract = lftk.search_features(family="wordsent", language="general", return_format="list_key")
34
+ # extracted_features = LFTK_extractor.extract(features=features_to_extract)
35
 
36
+ # print('Linguistic Features:', extracted_features)
37
 
38
+ # return extracted_features
39
 
40
 
41
  def update_api_key(new_key):
 
295
  task_btn.click(llama_strategies_respond, inputs=[strategy3, task, task_linguistic_entities, task_prompt, llama_S3_chatbot],
296
  outputs=[task, task_prompt, llama_S3_chatbot])
297
 
298
+ # Event Handler for GPT 3.5 Chatbot POS/Chunk, user must submit api key before submitting the prompt
299
  # Will activate after getting API key
300
  # task_apikey_btn.click(update_api_key, inputs=ling_ents_apikey_input)
301
  # task_btn.click(gpt_strategies_respond, inputs=[strategy1, task, task_linguistic_entities, gpt_S1_chatbot],