isaacus 0.10.1__py3-none-any.whl → 0.12.0__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.
- isaacus/_version.py +1 -1
- isaacus/resources/classifications/universal.py +8 -8
- isaacus/resources/embeddings.py +24 -24
- isaacus/resources/enrichments.py +2 -2
- isaacus/resources/extractions/__init__.py +12 -12
- isaacus/resources/extractions/extractions.py +18 -18
- isaacus/resources/extractions/qa.py +29 -29
- isaacus/resources/rerankings.py +12 -12
- isaacus/types/__init__.py +14 -0
- isaacus/types/classifications/universal_classification_response.py +22 -22
- isaacus/types/classifications/universal_create_params.py +6 -6
- isaacus/types/embedding_create_params.py +11 -11
- isaacus/types/embedding_response.py +3 -3
- isaacus/types/enrichment_create_params.py +1 -1
- isaacus/types/enrichment_response.py +6 -1404
- isaacus/types/extractions/__init__.py +1 -1
- isaacus/types/extractions/answer_extraction_response.py +12 -12
- isaacus/types/extractions/qa_create_params.py +8 -8
- isaacus/types/ilgs_v1_crossreference.py +42 -0
- isaacus/types/ilgs_v1_date.py +70 -0
- isaacus/types/ilgs_v1_document.py +172 -0
- isaacus/types/ilgs_v1_email.py +27 -0
- isaacus/types/ilgs_v1_external_document.py +101 -0
- isaacus/types/ilgs_v1_id_number.py +27 -0
- isaacus/types/ilgs_v1_location.py +53 -0
- isaacus/types/ilgs_v1_person.py +195 -0
- isaacus/types/ilgs_v1_phone_number.py +30 -0
- isaacus/types/ilgs_v1_quote.py +52 -0
- isaacus/types/ilgs_v1_segment.py +205 -0
- isaacus/types/ilgs_v1_span.py +28 -0
- isaacus/types/ilgs_v1_term.py +59 -0
- isaacus/types/ilgs_v1_website.py +28 -0
- isaacus/types/reranking_create_params.py +7 -7
- {isaacus-0.10.1.dist-info → isaacus-0.12.0.dist-info}/METADATA +1 -1
- isaacus-0.12.0.dist-info/RECORD +70 -0
- isaacus-0.10.1.dist-info/RECORD +0 -56
- {isaacus-0.10.1.dist-info → isaacus-0.12.0.dist-info}/WHEEL +0 -0
- {isaacus-0.10.1.dist-info → isaacus-0.12.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -10,6 +10,15 @@ __all__ = ["AnswerExtractionResponse", "Extraction", "ExtractionAnswer", "Usage"
|
|
|
10
10
|
class ExtractionAnswer(BaseModel):
|
|
11
11
|
"""An answer extracted from a text."""
|
|
12
12
|
|
|
13
|
+
text: str
|
|
14
|
+
"""The text of the answer."""
|
|
15
|
+
|
|
16
|
+
start: int
|
|
17
|
+
"""
|
|
18
|
+
The index of the first character of the answer in the text, starting from `0`
|
|
19
|
+
(and, therefore, ending at the number of characters in the text minus `1`).
|
|
20
|
+
"""
|
|
21
|
+
|
|
13
22
|
end: int
|
|
14
23
|
"""
|
|
15
24
|
The index of the character immediately after the last character of the answer in
|
|
@@ -22,28 +31,19 @@ class ExtractionAnswer(BaseModel):
|
|
|
22
31
|
A score between `0` and `1`, inclusive, representing the strength of the answer.
|
|
23
32
|
"""
|
|
24
33
|
|
|
25
|
-
start: int
|
|
26
|
-
"""
|
|
27
|
-
The index of the first character of the answer in the text, starting from `0`
|
|
28
|
-
(and, therefore, ending at the number of characters in the text minus `1`).
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
text: str
|
|
32
|
-
"""The text of the answer."""
|
|
33
|
-
|
|
34
34
|
|
|
35
35
|
class Extraction(BaseModel):
|
|
36
36
|
"""The result of extracting answers from a text."""
|
|
37
37
|
|
|
38
|
-
answers: List[ExtractionAnswer]
|
|
39
|
-
"""Answers extracted from the text, ordered from highest to lowest score."""
|
|
40
|
-
|
|
41
38
|
index: int
|
|
42
39
|
"""
|
|
43
40
|
The index of the text in the input array of texts that this result represents,
|
|
44
41
|
starting from `0` (and, therefore, ending at the number of texts minus `1`).
|
|
45
42
|
"""
|
|
46
43
|
|
|
44
|
+
answers: List[ExtractionAnswer]
|
|
45
|
+
"""Answers extracted from the text, ordered from highest to lowest score."""
|
|
46
|
+
|
|
47
47
|
inextractability_score: float
|
|
48
48
|
"""
|
|
49
49
|
A score between `0` and `1`, inclusive, representing the likelihood that an
|
|
@@ -7,10 +7,10 @@ from typing_extensions import Literal, Required, TypedDict
|
|
|
7
7
|
|
|
8
8
|
from ..._types import SequenceNotStr
|
|
9
9
|
|
|
10
|
-
__all__ = ["
|
|
10
|
+
__all__ = ["QACreateParams", "ChunkingOptions"]
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class
|
|
13
|
+
class QACreateParams(TypedDict, total=False):
|
|
14
14
|
model: Required[Literal["kanon-answer-extractor", "kanon-answer-extractor-mini"]]
|
|
15
15
|
"""
|
|
16
16
|
The ID of the
|
|
@@ -35,9 +35,6 @@ class QaCreateParams(TypedDict, total=False):
|
|
|
35
35
|
Each text must contain at least one non-whitespace character.
|
|
36
36
|
"""
|
|
37
37
|
|
|
38
|
-
chunking_options: Optional[ChunkingOptions]
|
|
39
|
-
"""Options for how to split text into smaller chunks."""
|
|
40
|
-
|
|
41
38
|
ignore_inextractability: bool
|
|
42
39
|
"""
|
|
43
40
|
Whether to, if the model's score of the likelihood that an answer can not be
|
|
@@ -55,15 +52,18 @@ class QaCreateParams(TypedDict, total=False):
|
|
|
55
52
|
If `null`, which is the default, all answers will be returned.
|
|
56
53
|
"""
|
|
57
54
|
|
|
55
|
+
chunking_options: Optional[ChunkingOptions]
|
|
56
|
+
"""Options for how to split text into smaller chunks."""
|
|
57
|
+
|
|
58
58
|
|
|
59
59
|
class ChunkingOptions(TypedDict, total=False):
|
|
60
60
|
"""Options for how to split text into smaller chunks."""
|
|
61
61
|
|
|
62
|
+
size: Optional[int]
|
|
63
|
+
"""A whole number greater than or equal to 1."""
|
|
64
|
+
|
|
62
65
|
overlap_ratio: Optional[float]
|
|
63
66
|
"""A number greater than or equal to 0 and less than 1."""
|
|
64
67
|
|
|
65
68
|
overlap_tokens: Optional[int]
|
|
66
69
|
"""A whole number greater than or equal to 0."""
|
|
67
|
-
|
|
68
|
-
size: Optional[int]
|
|
69
|
-
"""A whole number greater than or equal to 1."""
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .._models import BaseModel
|
|
4
|
+
from .ilgs_v1_span import ILGSv1Span
|
|
5
|
+
|
|
6
|
+
__all__ = ["ILGSv1Crossreference"]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ILGSv1Crossreference(BaseModel):
|
|
10
|
+
"""A cross-reference within the document pointing to one or more segments."""
|
|
11
|
+
|
|
12
|
+
start: str
|
|
13
|
+
"""
|
|
14
|
+
The unique identifier of the earliest segment in the span of segments being
|
|
15
|
+
cross-referenced with ties broken in favor of the least-nested (i.e., largest)
|
|
16
|
+
segment. If the cross-reference points to a single segment, `start` and `end`
|
|
17
|
+
will be identical.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
end: str
|
|
21
|
+
"""
|
|
22
|
+
The unique identifier of the latest segment in the span of segments being
|
|
23
|
+
cross-referenced with ties broken in favor of the least-nested (i.e., largest)
|
|
24
|
+
segment. If the cross-reference points to a single segment, `start` and `end`
|
|
25
|
+
will be identical.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
span: ILGSv1Span
|
|
29
|
+
"""A zero-based, half-open span into the Unicode code point space of input text.
|
|
30
|
+
|
|
31
|
+
All spans are globally laminar and well-nested similar to XML—it is impossible
|
|
32
|
+
for any two spans to partially overlap; they can only be disjoint, adjacent, or
|
|
33
|
+
wholly nested. Spans of the exact same type (e.g., segments) will never be
|
|
34
|
+
duplicated.
|
|
35
|
+
|
|
36
|
+
A span cannot be empty and will never start or end at whitespace.
|
|
37
|
+
|
|
38
|
+
Note that, when using programming languages other than Python (which uses
|
|
39
|
+
zero-based, half-open, Unicode code point-spaced string indexing), indices may
|
|
40
|
+
need to be translated accordingly (for example, JavaScript slices into UTF-16
|
|
41
|
+
code units instead of Unicode code points).
|
|
42
|
+
"""
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
from .ilgs_v1_span import ILGSv1Span
|
|
8
|
+
|
|
9
|
+
__all__ = ["ILGSv1Date"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ILGSv1Date(BaseModel):
|
|
13
|
+
"""
|
|
14
|
+
A date identified in a document belonging to one of the following types: `creation`, `signature`, `effective`, `expiry`, `delivery`, `renewal`, `payment`, `birth`, or `death`.
|
|
15
|
+
|
|
16
|
+
Only Gregorian dates between the years 1000 and 9999 (inclusive) fitting into one of the supported date types are extractable.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
value: str
|
|
20
|
+
"""The date in ISO 8601 format (YYYY-MM-DD)."""
|
|
21
|
+
|
|
22
|
+
type: Literal["creation", "signature", "effective", "expiry", "delivery", "renewal", "payment", "birth", "death"]
|
|
23
|
+
"""
|
|
24
|
+
The type of the date, being one of `creation`, `signature`, `effective`,
|
|
25
|
+
`expiry`, `delivery`, `renewal`, `payment`, `birth`, or `death`. If a date is
|
|
26
|
+
mentioned in a document that does not fit into a supported type, it will not be
|
|
27
|
+
extracted.
|
|
28
|
+
|
|
29
|
+
`creation` denotes the date the document was created. There may only be one
|
|
30
|
+
`creation` date per document.
|
|
31
|
+
|
|
32
|
+
`signature` denotes the date the document was signed.
|
|
33
|
+
|
|
34
|
+
`effective` denotes the date when the document or a part thereof comes into
|
|
35
|
+
effect (e.g., commencement or enactment dates).
|
|
36
|
+
|
|
37
|
+
`expiry` denotes the date when the document or a part thereof is no longer in
|
|
38
|
+
effect.
|
|
39
|
+
|
|
40
|
+
`delivery` denotes the date when goods or services are to be delivered under the
|
|
41
|
+
document.
|
|
42
|
+
|
|
43
|
+
`renewal` denotes the date when one or more of the document's terms are to be
|
|
44
|
+
renewed.
|
|
45
|
+
|
|
46
|
+
`payment` denotes the date when payment is to be made under the document.
|
|
47
|
+
|
|
48
|
+
`birth` denotes the birth date of a natural person or establishment (e.g.,
|
|
49
|
+
incorporation) date of a non-natural legal person identified in the document.
|
|
50
|
+
There can only be one `birth` date linked to a single person and all `birth`
|
|
51
|
+
dates must be linked to a person. A person's `birth` date will never be after
|
|
52
|
+
their `death` date.
|
|
53
|
+
|
|
54
|
+
`death` denotes the death date of a natural person or dissolution date of a
|
|
55
|
+
non-natural legal person identified in the document. There can only be one
|
|
56
|
+
`death` date linked to a single person and all `death` dates must be linked to a
|
|
57
|
+
person. A person's `death` date will never be before their `birth` date.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
person: Optional[str] = None
|
|
61
|
+
"""
|
|
62
|
+
A unique identifier for a legal person in the format `per:{index}` where
|
|
63
|
+
`{index}` is a non-negative incrementing integer starting from zero.
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
mentions: List[ILGSv1Span]
|
|
67
|
+
"""
|
|
68
|
+
An array of one or more spans within the document's text where the date is
|
|
69
|
+
mentioned.
|
|
70
|
+
"""
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
from .ilgs_v1_date import ILGSv1Date
|
|
8
|
+
from .ilgs_v1_span import ILGSv1Span
|
|
9
|
+
from .ilgs_v1_term import ILGSv1Term
|
|
10
|
+
from .ilgs_v1_email import ILGSv1Email
|
|
11
|
+
from .ilgs_v1_quote import ILGSv1Quote
|
|
12
|
+
from .ilgs_v1_person import ILGSv1Person
|
|
13
|
+
from .ilgs_v1_segment import ILGSv1Segment
|
|
14
|
+
from .ilgs_v1_website import ILGSv1Website
|
|
15
|
+
from .ilgs_v1_location import ILGSv1Location
|
|
16
|
+
from .ilgs_v1_id_number import ILGSv1IDNumber
|
|
17
|
+
from .ilgs_v1_phone_number import ILGSv1PhoneNumber
|
|
18
|
+
from .ilgs_v1_crossreference import ILGSv1Crossreference
|
|
19
|
+
from .ilgs_v1_external_document import ILGSv1ExternalDocument
|
|
20
|
+
|
|
21
|
+
__all__ = ["ILGSv1Document"]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ILGSv1Document(BaseModel):
|
|
25
|
+
"""The enriched document."""
|
|
26
|
+
|
|
27
|
+
title: Optional[ILGSv1Span] = None
|
|
28
|
+
"""A zero-based, half-open span into the Unicode code point space of input text.
|
|
29
|
+
|
|
30
|
+
All spans are globally laminar and well-nested similar to XML—it is impossible
|
|
31
|
+
for any two spans to partially overlap; they can only be disjoint, adjacent, or
|
|
32
|
+
wholly nested. Spans of the exact same type (e.g., segments) will never be
|
|
33
|
+
duplicated.
|
|
34
|
+
|
|
35
|
+
A span cannot be empty and will never start or end at whitespace.
|
|
36
|
+
|
|
37
|
+
Note that, when using programming languages other than Python (which uses
|
|
38
|
+
zero-based, half-open, Unicode code point-spaced string indexing), indices may
|
|
39
|
+
need to be translated accordingly (for example, JavaScript slices into UTF-16
|
|
40
|
+
code units instead of Unicode code points).
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
subtitle: Optional[ILGSv1Span] = None
|
|
44
|
+
"""A zero-based, half-open span into the Unicode code point space of input text.
|
|
45
|
+
|
|
46
|
+
All spans are globally laminar and well-nested similar to XML—it is impossible
|
|
47
|
+
for any two spans to partially overlap; they can only be disjoint, adjacent, or
|
|
48
|
+
wholly nested. Spans of the exact same type (e.g., segments) will never be
|
|
49
|
+
duplicated.
|
|
50
|
+
|
|
51
|
+
A span cannot be empty and will never start or end at whitespace.
|
|
52
|
+
|
|
53
|
+
Note that, when using programming languages other than Python (which uses
|
|
54
|
+
zero-based, half-open, Unicode code point-spaced string indexing), indices may
|
|
55
|
+
need to be translated accordingly (for example, JavaScript slices into UTF-16
|
|
56
|
+
code units instead of Unicode code points).
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
type: Literal["statute", "regulation", "decision", "contract", "other"]
|
|
60
|
+
"""
|
|
61
|
+
The type of the document, being one of `statute`, `regulation`, `decision`,
|
|
62
|
+
`contract`, or `other`.
|
|
63
|
+
|
|
64
|
+
`statute` denotes primary legislation such as acts, bills, codes, and
|
|
65
|
+
constitutions.
|
|
66
|
+
|
|
67
|
+
`regulation` denotes secondary legislation such as rules, statutory instruments,
|
|
68
|
+
and ordinances.
|
|
69
|
+
|
|
70
|
+
`decision` denotes judicial or quasi-judicial decisions such as court judgments,
|
|
71
|
+
judicial opinions, and tribunal rulings.
|
|
72
|
+
|
|
73
|
+
`other` is used for all other types of legal documents that do not fit into any
|
|
74
|
+
of the predefined types.
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
jurisdiction: Optional[str] = None
|
|
78
|
+
"""
|
|
79
|
+
A jurisdiction code representing a country (via an initial country code) and,
|
|
80
|
+
optionally, a subdivision within that country (via a subsequent subdivision code
|
|
81
|
+
prefixed by a hyphen).
|
|
82
|
+
|
|
83
|
+
All 249 ISO 3166-1 alpha-2 country codes are representable in addition to
|
|
84
|
+
special `INT` and `EU` codes for international and European Union law,
|
|
85
|
+
respectively.
|
|
86
|
+
|
|
87
|
+
All 5,046 ISO 3166-2 codes are also representable in addition to a special `FED`
|
|
88
|
+
code for federal law.
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
segments: List[ILGSv1Segment]
|
|
92
|
+
"""
|
|
93
|
+
An array of segments within the document representing structurally distinct
|
|
94
|
+
portions of its content.
|
|
95
|
+
"""
|
|
96
|
+
|
|
97
|
+
crossreferences: List[ILGSv1Crossreference]
|
|
98
|
+
"""
|
|
99
|
+
An array of cross-references within the document pointing to a single segment or
|
|
100
|
+
a span of segments.
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
locations: List[ILGSv1Location]
|
|
104
|
+
"""An array of locations identified in the document."""
|
|
105
|
+
|
|
106
|
+
persons: List[ILGSv1Person]
|
|
107
|
+
"""An array of legal persons identified in the document."""
|
|
108
|
+
|
|
109
|
+
emails: List[ILGSv1Email]
|
|
110
|
+
"""
|
|
111
|
+
An array of email addresses identified in the document belonging to legal
|
|
112
|
+
persons.
|
|
113
|
+
|
|
114
|
+
Email addresses mentioned in the document that are not attributable to legal
|
|
115
|
+
persons will not be extracted.
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
websites: List[ILGSv1Website]
|
|
119
|
+
"""An array of websites identified in the document belonging to legal persons.
|
|
120
|
+
|
|
121
|
+
Websites mentioned in the document that are not attributable to legal persons
|
|
122
|
+
will not be extracted.
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
phone_numbers: List[ILGSv1PhoneNumber]
|
|
126
|
+
"""
|
|
127
|
+
An array of valid phone numbers identified in the document belonging to legal
|
|
128
|
+
persons.
|
|
129
|
+
|
|
130
|
+
Phone numbers mentioned in the document that are not valid, possible, or
|
|
131
|
+
attributable to legal persons will not be extracted.
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
id_numbers: List[ILGSv1IDNumber]
|
|
135
|
+
"""
|
|
136
|
+
An array of identification numbers identified in the document belonging to legal
|
|
137
|
+
persons.
|
|
138
|
+
|
|
139
|
+
Identification numbers mentioned in the document that are not attributable to
|
|
140
|
+
legal persons will not be extracted.
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
terms: List[ILGSv1Term]
|
|
144
|
+
"""An array of terms assigned definite meanings within the document."""
|
|
145
|
+
|
|
146
|
+
external_documents: List[ILGSv1ExternalDocument]
|
|
147
|
+
"""An array of documents identified within the document."""
|
|
148
|
+
|
|
149
|
+
quotes: List[ILGSv1Quote]
|
|
150
|
+
"""An array of quotations within the document."""
|
|
151
|
+
|
|
152
|
+
dates: List[ILGSv1Date]
|
|
153
|
+
"""
|
|
154
|
+
An array of dates identified in the document belonging to one of the following
|
|
155
|
+
types: `creation`, `signature`, `effective`, `expiry`, `delivery`, `renewal`,
|
|
156
|
+
`payment`, `birth`, or `death`.
|
|
157
|
+
|
|
158
|
+
Only Gregorian dates between the years 1000 and 9999 (inclusive) fitting into
|
|
159
|
+
one of the supported date types are extractable.
|
|
160
|
+
"""
|
|
161
|
+
|
|
162
|
+
headings: List[ILGSv1Span]
|
|
163
|
+
"""An array of spans within the document's text constituting headings."""
|
|
164
|
+
|
|
165
|
+
junk: List[ILGSv1Span]
|
|
166
|
+
"""
|
|
167
|
+
An array of spans within the document's text constituting non-operative,
|
|
168
|
+
non-substantive 'junk' content such as headers, footers, page numbers, and OCR
|
|
169
|
+
artifacts.
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
version: Literal["ilgs@1"]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
from .ilgs_v1_span import ILGSv1Span
|
|
7
|
+
|
|
8
|
+
__all__ = ["ILGSv1Email"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ILGSv1Email(BaseModel):
|
|
12
|
+
"""An email address identified in a document belonging to a legal person.
|
|
13
|
+
|
|
14
|
+
If an email address was mentioned in the document but is not attributable to a legal person, it will not be extracted.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
address: str
|
|
18
|
+
"""The normalized email address."""
|
|
19
|
+
|
|
20
|
+
person: str
|
|
21
|
+
"""The unique identifier of the person that this email address belongs to."""
|
|
22
|
+
|
|
23
|
+
mentions: List[ILGSv1Span]
|
|
24
|
+
"""
|
|
25
|
+
An array of one or more spans within the document's text where the email address
|
|
26
|
+
is mentioned.
|
|
27
|
+
"""
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
from .ilgs_v1_span import ILGSv1Span
|
|
8
|
+
|
|
9
|
+
__all__ = ["ILGSv1ExternalDocument"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ILGSv1ExternalDocument(BaseModel):
|
|
13
|
+
"""A document identified within another document."""
|
|
14
|
+
|
|
15
|
+
id: str
|
|
16
|
+
"""
|
|
17
|
+
The unique identifier of the external document in the format `exd:{index}` where
|
|
18
|
+
`{index}` is a non-negative incrementing integer starting from zero.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: ILGSv1Span
|
|
22
|
+
"""A zero-based, half-open span into the Unicode code point space of input text.
|
|
23
|
+
|
|
24
|
+
All spans are globally laminar and well-nested similar to XML—it is impossible
|
|
25
|
+
for any two spans to partially overlap; they can only be disjoint, adjacent, or
|
|
26
|
+
wholly nested. Spans of the exact same type (e.g., segments) will never be
|
|
27
|
+
duplicated.
|
|
28
|
+
|
|
29
|
+
A span cannot be empty and will never start or end at whitespace.
|
|
30
|
+
|
|
31
|
+
Note that, when using programming languages other than Python (which uses
|
|
32
|
+
zero-based, half-open, Unicode code point-spaced string indexing), indices may
|
|
33
|
+
need to be translated accordingly (for example, JavaScript slices into UTF-16
|
|
34
|
+
code units instead of Unicode code points).
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
type: Literal["statute", "regulation", "decision", "contract", "other"]
|
|
38
|
+
"""
|
|
39
|
+
The type of the external document, being one of `statute`, `regulation`,
|
|
40
|
+
`decision`, `contract`, or `other`.
|
|
41
|
+
|
|
42
|
+
`statute` denotes primary legislation such as acts, bills, codes, and
|
|
43
|
+
constitutions.
|
|
44
|
+
|
|
45
|
+
`regulation` denotes secondary legislation such as rules, statutory instruments,
|
|
46
|
+
and ordinances.
|
|
47
|
+
|
|
48
|
+
`decision` denotes judicial or quasi-judicial decisions such as court judgments,
|
|
49
|
+
judicial opinions, and tribunal rulings.
|
|
50
|
+
|
|
51
|
+
`other` is used for all other types of legal documents that do not fit into any
|
|
52
|
+
of the predefined types.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
jurisdiction: Optional[str] = None
|
|
56
|
+
"""
|
|
57
|
+
A jurisdiction code representing a country (via an initial country code) and,
|
|
58
|
+
optionally, a subdivision within that country (via a subsequent subdivision code
|
|
59
|
+
prefixed by a hyphen).
|
|
60
|
+
|
|
61
|
+
All 249 ISO 3166-1 alpha-2 country codes are representable in addition to
|
|
62
|
+
special `INT` and `EU` codes for international and European Union law,
|
|
63
|
+
respectively.
|
|
64
|
+
|
|
65
|
+
All 5,046 ISO 3166-2 codes are also representable in addition to a special `FED`
|
|
66
|
+
code for federal law.
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
reception: Literal["positive", "mixed", "negative", "neutral"]
|
|
70
|
+
"""
|
|
71
|
+
The sentiment of the document towards the external document, being one of
|
|
72
|
+
`positive`, `mixed`, `negative`, or `neutral`.
|
|
73
|
+
|
|
74
|
+
`positive` indicates that the document expresses a favorable view of the
|
|
75
|
+
external document whether by endorsing or approving it.
|
|
76
|
+
|
|
77
|
+
`mixed` indicates that the document expresses both favorable and unfavorable
|
|
78
|
+
views of the external document, for example, by affirming parts of it and
|
|
79
|
+
disapproving others.
|
|
80
|
+
|
|
81
|
+
`negative` indicates that the document expresses an unfavorable view of the
|
|
82
|
+
external document whether by criticizing, repealing, overruling, or explicitly
|
|
83
|
+
contradicting it.
|
|
84
|
+
|
|
85
|
+
`neutral` indicates that the document references the external document without
|
|
86
|
+
expressing any particular sentiment towards it.
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
mentions: List[ILGSv1Span]
|
|
90
|
+
"""
|
|
91
|
+
An array of one or more spans within the document's text where the external
|
|
92
|
+
document is mentioned by name, for example, 'the US Constitution' in 'the Second
|
|
93
|
+
Amendment to the US Constitution protects freedom of speech'.
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
pinpoints: List[ILGSv1Span]
|
|
97
|
+
"""
|
|
98
|
+
An array of spans within the document's text where specific parts of the
|
|
99
|
+
external document are referenced, for example, 'Section 2' in 'as defined in
|
|
100
|
+
Section 2 of the US Constitution'.
|
|
101
|
+
"""
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
from .ilgs_v1_span import ILGSv1Span
|
|
7
|
+
|
|
8
|
+
__all__ = ["ILGSv1IDNumber"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ILGSv1IDNumber(BaseModel):
|
|
12
|
+
"""An identification number mentioned in a document belonging to a legal person.
|
|
13
|
+
|
|
14
|
+
If an identification number was mentioned in the document but is not attributable to a legal person, it will not be extracted.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
number: str
|
|
18
|
+
"""The identification number."""
|
|
19
|
+
|
|
20
|
+
person: str
|
|
21
|
+
"""The unique identifier of the person that this identification number belongs to."""
|
|
22
|
+
|
|
23
|
+
mentions: List[ILGSv1Span]
|
|
24
|
+
"""
|
|
25
|
+
An array of one or more spans within the document's text where the
|
|
26
|
+
identification number is mentioned.
|
|
27
|
+
"""
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
from .ilgs_v1_span import ILGSv1Span
|
|
8
|
+
|
|
9
|
+
__all__ = ["ILGSv1Location"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ILGSv1Location(BaseModel):
|
|
13
|
+
"""A location identified within a document."""
|
|
14
|
+
|
|
15
|
+
id: str
|
|
16
|
+
"""
|
|
17
|
+
The unique identifier of the location in the format `loc:{index}` where
|
|
18
|
+
`{index}` is a non-negative incrementing integer starting from zero.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: ILGSv1Span
|
|
22
|
+
"""A zero-based, half-open span into the Unicode code point space of input text.
|
|
23
|
+
|
|
24
|
+
All spans are globally laminar and well-nested similar to XML—it is impossible
|
|
25
|
+
for any two spans to partially overlap; they can only be disjoint, adjacent, or
|
|
26
|
+
wholly nested. Spans of the exact same type (e.g., segments) will never be
|
|
27
|
+
duplicated.
|
|
28
|
+
|
|
29
|
+
A span cannot be empty and will never start or end at whitespace.
|
|
30
|
+
|
|
31
|
+
Note that, when using programming languages other than Python (which uses
|
|
32
|
+
zero-based, half-open, Unicode code point-spaced string indexing), indices may
|
|
33
|
+
need to be translated accordingly (for example, JavaScript slices into UTF-16
|
|
34
|
+
code units instead of Unicode code points).
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
type: Literal["country", "state", "city", "address", "other"]
|
|
38
|
+
"""
|
|
39
|
+
The type of the location, being one of `country`, `state`, `city`, `address`, or
|
|
40
|
+
`other`.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
parent: Optional[str] = None
|
|
44
|
+
"""
|
|
45
|
+
A unique identifier for a location in the format `loc:{index}` where `{index}`
|
|
46
|
+
is a non-negative incrementing integer starting from zero.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
mentions: List[ILGSv1Span]
|
|
50
|
+
"""
|
|
51
|
+
An array of one or more spans within the document's text where the location is
|
|
52
|
+
mentioned.
|
|
53
|
+
"""
|