llm-ie 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
llm_ie/extractors.py CHANGED
@@ -1,6 +1,6 @@
1
- import os
2
1
  import abc
3
2
  import re
3
+ import json
4
4
  import importlib.resources
5
5
  from typing import List, Dict, Tuple, Union
6
6
  from llm_ie.data_types import LLMInformationExtractionFrame
@@ -70,12 +70,12 @@ class FrameExtractor:
70
70
  """
71
71
  pattern = r'\{.*?\}'
72
72
  out = []
73
- for tup in re.findall(pattern, gen_text):
73
+ for match in re.findall(pattern, gen_text, re.DOTALL):
74
74
  try:
75
- tup_dict = eval(tup)
75
+ tup_dict = json.loads(match)
76
76
  out.append(tup_dict)
77
- except:
78
- print(f'Post-processing failed at:\n{tup}')
77
+ except json.JSONDecodeError:
78
+ print(f'Post-processing failed at:\n{match}')
79
79
  return out
80
80
 
81
81
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: llm-ie
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: An LLM-powered tool that transforms everyday language into robust information extraction pipelines.
5
5
  License: MIT
6
6
  Author: Enshuo (David) Hsu
@@ -6,8 +6,8 @@ llm_ie/asset/prompt_guide/ReviewFrameExtractor_prompt_guide.txt,sha256=XbnU8byLG
6
6
  llm_ie/asset/prompt_guide/SentenceFrameExtractor_prompt_guide.txt,sha256=8nj9OLPJMtr9Soi5JU3Xk-HC7pKNoI54xA_A4u7I5j4,2620
7
7
  llm_ie/data_types.py,sha256=AxqgfmPkYySDz7VuTWh8yDWofvZgdjgFiW9hihqInHc,6605
8
8
  llm_ie/engines.py,sha256=TuxM56_u6-dsAAuNdfuKSH23nb9UfFbg6T60e-OXEA8,9294
9
- llm_ie/extractors.py,sha256=cYfxKzOxs6fsFbcA0KvEGDXHOPBojNpDG7kfrV7Tsbc,22355
9
+ llm_ie/extractors.py,sha256=v_VZnpb7PPRlZC4X55k_w2t6X2W3NFWe8ZHo57q7s4Y,22401
10
10
  llm_ie/prompt_editor.py,sha256=dbu7A3O7O7Iw2v-xCgrTFH1-wTLAGf4SHDqdeS-He2Q,1869
11
- llm_ie-0.1.3.dist-info/METADATA,sha256=3cn2apV_x-zhyGXyvUnVUhonBhdGGYlrrU10tZvnORQ,28028
12
- llm_ie-0.1.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
13
- llm_ie-0.1.3.dist-info/RECORD,,
11
+ llm_ie-0.1.4.dist-info/METADATA,sha256=-P_iDB6jMLm8Qb-paUAiwGsDu4d_SZIcaDXISnN36H4,28028
12
+ llm_ie-0.1.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
13
+ llm_ie-0.1.4.dist-info/RECORD,,
File without changes