llm-ie 0.1.3__tar.gz → 0.1.4__tar.gz

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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "llm-ie"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  description = "An LLM-powered tool that transforms everyday language into robust information extraction pipelines."
5
5
  authors = ["Enshuo (David) Hsu"]
6
6
  license = "MIT"
@@ -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
 
File without changes
File without changes
File without changes
File without changes