hyperbase 0.8.0__tar.gz → 0.10.0__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.
Files changed (111) hide show
  1. hyperbase-0.10.0/.pre-commit-config.yaml +7 -0
  2. {hyperbase-0.8.0 → hyperbase-0.10.0}/CHANGELOG.md +115 -4
  3. {hyperbase-0.8.0 → hyperbase-0.10.0}/PKG-INFO +7 -1
  4. hyperbase-0.10.0/VERSION +1 -0
  5. hyperbase-0.10.0/docs/assets/stylesheets/extra.css +19 -0
  6. hyperbase-0.10.0/docs/installation.md +141 -0
  7. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/manual/api.md +1 -9
  8. hyperbase-0.10.0/docs/manual/hyperedges.md +505 -0
  9. hyperbase-0.10.0/docs/manual/parsers.md +214 -0
  10. hyperbase-0.10.0/docs/manual/patterns.md +215 -0
  11. hyperbase-0.10.0/docs/manual/readers.md +140 -0
  12. hyperbase-0.10.0/docs/tutorials/parsing-a-sentence.md +27 -0
  13. hyperbase-0.10.0/docs/tutorials/playing-with-hyperedges.md +265 -0
  14. {hyperbase-0.8.0 → hyperbase-0.10.0}/mkdocs.yml +7 -5
  15. {hyperbase-0.8.0 → hyperbase-0.10.0}/pyproject.toml +21 -0
  16. hyperbase-0.10.0/src/hyperbase/__init__.py +9 -0
  17. hyperbase-0.10.0/src/hyperbase/builders.py +187 -0
  18. hyperbase-0.10.0/src/hyperbase/cli/__init__.py +202 -0
  19. hyperbase-0.10.0/src/hyperbase/cli/parsers.py +11 -0
  20. hyperbase-0.10.0/src/hyperbase/cli/read.py +83 -0
  21. hyperbase-0.10.0/src/hyperbase/cli/repl.py +819 -0
  22. hyperbase-0.10.0/src/hyperbase/constants.py +105 -0
  23. hyperbase-0.10.0/src/hyperbase/correctness.py +150 -0
  24. hyperbase-0.10.0/src/hyperbase/data/wikipedia/discard_sections.txt +2096 -0
  25. hyperbase-0.10.0/src/hyperbase/hyperedge.py +634 -0
  26. hyperbase-0.10.0/src/hyperbase/loaders.py +102 -0
  27. {hyperbase-0.8.0 → hyperbase-0.10.0}/src/hyperbase/parsers/__init__.py +15 -7
  28. hyperbase-0.10.0/src/hyperbase/parsers/parse_result.py +70 -0
  29. hyperbase-0.10.0/src/hyperbase/parsers/parser.py +175 -0
  30. hyperbase-0.10.0/src/hyperbase/parsers/repl_api.py +63 -0
  31. hyperbase-0.10.0/src/hyperbase/parsers/utils.py +44 -0
  32. hyperbase-0.10.0/src/hyperbase/patterns/__init__.py +10 -0
  33. hyperbase-0.10.0/src/hyperbase/patterns/checks.py +71 -0
  34. hyperbase-0.10.0/src/hyperbase/patterns/combine.py +353 -0
  35. {hyperbase-0.8.0 → hyperbase-0.10.0}/src/hyperbase/patterns/counter.py +47 -56
  36. hyperbase-0.10.0/src/hyperbase/patterns/matcher.py +643 -0
  37. hyperbase-0.10.0/src/hyperbase/readers/__init__.py +8 -0
  38. hyperbase-0.10.0/src/hyperbase/readers/reader.py +208 -0
  39. hyperbase-0.10.0/src/hyperbase/readers/txt.py +30 -0
  40. hyperbase-0.10.0/src/hyperbase/readers/url.py +40 -0
  41. hyperbase-0.10.0/src/hyperbase/readers/wikipedia.py +296 -0
  42. hyperbase-0.10.0/src/hyperbase/transforms.py +155 -0
  43. hyperbase-0.10.0/tests/__init__.py +0 -0
  44. hyperbase-0.10.0/tests/test_correctness_errors.py +275 -0
  45. hyperbase-0.10.0/tests/test_hyperedge.py +1133 -0
  46. hyperbase-0.10.0/tests/test_hyperedge_text.py +127 -0
  47. hyperbase-0.10.0/tests/test_load_edges.py +158 -0
  48. hyperbase-0.10.0/tests/test_malformed_input.py +178 -0
  49. hyperbase-0.10.0/tests/test_parser_plugin.py +196 -0
  50. hyperbase-0.10.0/tests/test_patterns.py +1379 -0
  51. hyperbase-0.10.0/tests/test_performance.py +149 -0
  52. hyperbase-0.10.0/tests/test_reader_plugin.py +266 -0
  53. hyperbase-0.8.0/VERSION +0 -1
  54. hyperbase-0.8.0/docs/assets/stylesheets/extra.css +0 -21
  55. hyperbase-0.8.0/docs/installation.md +0 -57
  56. hyperbase-0.8.0/docs/manual/hyperedge-operations.md +0 -53
  57. hyperbase-0.8.0/docs/manual/parsing.md +0 -5
  58. hyperbase-0.8.0/docs/manual/patterns.md +0 -243
  59. hyperbase-0.8.0/docs/tutorials/parsing-a-sentence.md +0 -45
  60. hyperbase-0.8.0/src/hyperbase/__init__.py +0 -6
  61. hyperbase-0.8.0/src/hyperbase/constants.py +0 -4
  62. hyperbase-0.8.0/src/hyperbase/hyperedge.py +0 -1127
  63. hyperbase-0.8.0/src/hyperbase/parsers/correctness.py +0 -265
  64. hyperbase-0.8.0/src/hyperbase/parsers/parser.py +0 -41
  65. hyperbase-0.8.0/src/hyperbase/parsers/utils.py +0 -19
  66. hyperbase-0.8.0/src/hyperbase/patterns/__init__.py +0 -29
  67. hyperbase-0.8.0/src/hyperbase/patterns/argroles.py +0 -142
  68. hyperbase-0.8.0/src/hyperbase/patterns/atoms.py +0 -98
  69. hyperbase-0.8.0/src/hyperbase/patterns/common.py +0 -172
  70. hyperbase-0.8.0/src/hyperbase/patterns/entrypoints.py +0 -87
  71. hyperbase-0.8.0/src/hyperbase/patterns/matcher.py +0 -245
  72. hyperbase-0.8.0/src/hyperbase/patterns/merge.py +0 -52
  73. hyperbase-0.8.0/src/hyperbase/patterns/properties.py +0 -59
  74. hyperbase-0.8.0/src/hyperbase/patterns/utils.py +0 -118
  75. hyperbase-0.8.0/src/hyperbase/patterns/variables.py +0 -161
  76. hyperbase-0.8.0/tests/test_correctness.py +0 -324
  77. hyperbase-0.8.0/tests/test_hyperedge.py +0 -1107
  78. hyperbase-0.8.0/tests/test_patterns.py +0 -1039
  79. {hyperbase-0.8.0 → hyperbase-0.10.0}/.github/workflows/docs.yml +0 -0
  80. {hyperbase-0.8.0 → hyperbase-0.10.0}/.github/workflows/publish.yml +0 -0
  81. {hyperbase-0.8.0 → hyperbase-0.10.0}/.gitignore +0 -0
  82. {hyperbase-0.8.0 → hyperbase-0.10.0}/AUTHORS +0 -0
  83. {hyperbase-0.8.0 → hyperbase-0.10.0}/LICENSE +0 -0
  84. {hyperbase-0.8.0 → hyperbase-0.10.0}/README.md +0 -0
  85. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/atom-structure.png +0 -0
  86. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/authors/camille.jpg +0 -0
  87. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/authors/chih-chun.jpg +0 -0
  88. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/authors/kexinren.jpg +0 -0
  89. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/authors/max.jpg +0 -0
  90. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/authors/telmo.jpg +0 -0
  91. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/authors/yael-stein.jpg +0 -0
  92. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/block.png +0 -0
  93. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/favicon.png +0 -0
  94. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/graphbrain.png +0 -0
  95. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/hyper-vs-graph.png +0 -0
  96. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/hyperedge-blocks.png +0 -0
  97. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/logo_hyperquest_small_nav.svg +0 -0
  98. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/one-pagers/GB-A.pdf +0 -0
  99. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/one-pagers/GB-A_thumb.png +0 -0
  100. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/one-pagers/GB-C.pdf +0 -0
  101. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/one-pagers/GB-C_thumb.png +0 -0
  102. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/show.png +0 -0
  103. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/socsemics.png +0 -0
  104. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/assets/images/vblock.png +0 -0
  105. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/authors.md +0 -0
  106. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/index.md +0 -0
  107. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/manual/discovering-patterns.md +0 -0
  108. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/manual/notation.md +0 -0
  109. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/manual/overview.md +0 -0
  110. {hyperbase-0.8.0 → hyperbase-0.10.0}/docs/pubs-cases.md +0 -0
  111. {hyperbase-0.8.0/tests → hyperbase-0.10.0/src/hyperbase/data}/__init__.py +0 -0
@@ -0,0 +1,7 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.15.8
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ - id: ruff-format
@@ -1,19 +1,83 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.10.0] - 11-04-2026
4
+
5
+ ### Added
6
+
7
+ - `[]` pattern notation for specifying sequences of arguments.
8
+ - EdgeType and ArgRole enums.
9
+ - safety cap for match (`_MAX_ARGROLE_ITEMS=10`) against pathological edge arities.
10
+ - caching of computed `Hyperedge`/`Atom` properties.
11
+ - `parse_to_jsonl` method on `Parser`.
12
+ - unified parameter interface for parsers.
13
+ - method `Parser.accepted_params`.
14
+ - maximum depth protection for parsers.
15
+ - repl api for parsers.
16
+
17
+ ### Changed
18
+
19
+ - multiple patterns functions are now `Hyperedge`/`Atom` methods: `is_wildcard`, `is_pattern`, `is_fun_pattern`, `is_variable`, `contains_variable`, `variable_name`.
20
+ - `hyperbase.py` now delegating to smaller modules with well-defined concerns: `builders.py`, `correctness.py`, `transforms.py`, `patterns.checks.py` and `patterns.matcher.py`.
21
+ - replaced `itertools.permutations` with constraint-propagated backtracking in argrole matcher.
22
+ - `parse_text` renamed to `parse`; old iterator-based `parse` removed.
23
+ - `read_source` renamed to `parse_source`; `read_source_to_jsonl` renamed to `parse_source_to_jsonl`.
24
+ - renamed `sentensize` to `get_sentences`.
25
+ - hedge now uses an explicit stack instead of recursion (so that pathologically
26
+ nested edge strings cannot exhaust Python's call stack).
27
+ - renamed parsers.correctness to parsers.badness.
28
+
29
+ ### Removed
30
+
31
+ - `__add__` operator overloading in `Hyperedge`/`Atom`.
32
+
33
+ ## [0.9.0] - 05-04-2026
34
+
35
+ ### Added
36
+
37
+ - readers (txt, url, wikipedia).
38
+ - cli interface with repl, parsers, readers.
39
+ - hyperedge.Hyperedge.match function (calls parsers.match_pattern).
40
+ - ParseResults.
41
+ - HyperEdge.text.
42
+ - load_edges function.
43
+
44
+ ### Changed
45
+
46
+ - added get_parser to main functions (at hyperbase root).
47
+ - improved documentation.
48
+ - hedge now accepts ParseResults and can recursively add Hyperedge.text strings.
49
+ - renamed function hyperedge.str2atom to str_to_atom.
50
+ - Hyperedge is not a frozen dataclasse, instead of inheriting from tuple.
51
+ - hedge now throws exceptions instead of returning None values.
52
+ - Hyperedge.contains always recursive, removed deep argument.
53
+ - simplified Hyperedge.simplify.
54
+ - Hyperedge.insert_argrole now private, renamed to Hyperedge._insert_argrole.
55
+ - Renamed Hyperedge.insert_edge_with_argrole to add_argument, pos optional (default to add at the end).
56
+ - Renamed Hyperedge.edges_with_argrole to arguments_with_role.
57
+ - Renamed Hyperedge.normalized to normalise.
58
+
59
+ ### Removed
60
+
61
+ - function patterns.edge_matches_pattern.
62
+ - deprecated and obsolete methods from Hyperedge: is_atom, to_str, roots, insert_first_argument, connect, sequence, contains_atom_type, main_concepts, replace_main_concept, has_argroles.
63
+
3
64
  ## [0.8.0] - 26-03-2026 - hyperbase is the successor of graphbrain
4
65
 
5
66
  ### Added
67
+
6
68
  - parser plugin foundation.
7
69
  - more comprehensive Hyperedge.check_correctness.
8
70
  - check parse correctness.
9
71
  - type checking: full code coverage.
10
72
 
11
73
  ### Changed
74
+
12
75
  - renamed library to hyperbase.
13
76
  - trimmed down library to the essentials: hyperedge, patterns and parser foundations.
14
77
  - converted documentation to Material for MkDocs.
15
78
 
16
79
  ### Removed
80
+
17
81
  - hypergraph module, hypergraph database (memory module).
18
82
  - alphabeta parser implementation.
19
83
  - old scripts, examples, processors.
@@ -23,7 +87,9 @@
23
87
  - obsolete constants.
24
88
 
25
89
  ## [0.7.0] - 05-03-2026
90
+
26
91
  ### Added
92
+
27
93
  - patterns.is_wildcard().
28
94
  - Base class hypergraph.memory.keyvalue.KeyValue for key-value hypergraph databases, removing redundant code between LevelDB and SQLite.
29
95
  - Tests for LevelDB (only the SQLite Hypergraph implementation was being directly tested).
@@ -35,6 +101,7 @@
35
101
  - Hypergraph.get_attributes().
36
102
 
37
103
  ### Changed
104
+
38
105
  - Entire project is now in pure Python
39
106
  - Python >=3.10 now required.
40
107
  - Hypergraph.search(), .match() and .count() now working with functional patterns and argument role matching.
@@ -44,19 +111,25 @@
44
111
  - Matches from patterns with repeated variables are collected in lists.
45
112
 
46
113
  ### Removed
114
+
47
115
  - graphbrain.logic obsolete module.
48
116
  - LevelDB backend
49
117
 
50
118
  ## [0.6.1] - 31-10-2022
119
+
51
120
  ### Changed
52
- - Hyperedge.replace_argroles() .insert_argrole() and .insert_edge_with_argrole() now works with functional patterns such as var.
121
+
122
+ - Hyperedge.replace_argroles() .insert_argrole() and .add_argument() now works with functional patterns such as var.
53
123
  - Fixed bug when matching patterns containing atoms functional pattern where no atom has argroles.
54
124
 
55
125
  ### Removed
126
+
56
127
  - interactive_case_generator() from graphbrain.notebook.
57
128
 
58
129
  ## [0.6.0] - 27-10-2022
130
+
59
131
  ### Added
132
+
60
133
  - Hyperedge.atom and .not_atom properties.
61
134
  - Hyperedge.mtype() and .connector_mtype() methods.
62
135
  - Hyperedge.t, .mt, .ct and .cmt type shortcut properties.
@@ -65,12 +138,13 @@
65
138
  - Hypergraph.text().
66
139
  - Parser.parse_and_add().
67
140
  - Parser.sentences().
68
- - Hyperedge.normalized().
141
+ - Hyperedge.normalise().
69
142
  - New package graphbrain.readers, for text readers from various sources.
70
143
  - New package graphbrain.processors, for miscellaneous processors.
71
144
  - Processor class.
72
145
 
73
146
  ### Changed
147
+
74
148
  - Coreference resolution now using the new spaCy experimental model.
75
149
  - Now using spaCy transformer GPU models by default, can fallback to CPU model.
76
150
  - Hyperedge.is_atom() deprecated.
@@ -84,6 +158,7 @@
84
158
  - Hyperedge.argroles() now also works at relation/concept level.
85
159
 
86
160
  ### Removed
161
+
87
162
  - graphbrain.patterns.normalize_edge().
88
163
  - graphbrain.stats obsolete package.
89
164
  - graphbrain.cognition obsolete package.
@@ -91,18 +166,22 @@
91
166
  - Hyperedge .predicate() and .predicate_atom().
92
167
 
93
168
  ## [0.5.0] - 28-07-2021
169
+
94
170
  ### Added
171
+
95
172
  - SQLite3 hypergraph database backend.
96
173
  - Hypergraph.add_with_attributes().
97
174
  - import and export commands.
98
175
  - Hypergraph context manager for batch writes (with hopen(hg_locator) as hg ...).
99
176
 
100
177
  ### Changed
178
+
101
179
  - Main hypergraph database backend is now SQLite3.
102
180
  - LevelDB backend becomes optional. (disabled by default)
103
181
  - Neuralcoref becomes optional. (disabled by default)
104
182
 
105
183
  ### Removed
184
+
106
185
  - Hypergraph.atom_count().
107
186
  - Hypergraph.edge_count().
108
187
  - Hypergraph.primary_atom_count().
@@ -111,21 +190,29 @@
111
190
  - corefs_unidecode agent.
112
191
 
113
192
  ## [0.4.3] - 22-04-2021
193
+
114
194
  ### Changed
195
+
115
196
  - Fixed AlphaBeta bug related to temporary atoms being removed too soon from atom2tokens.
116
197
  - Hypergraph.add_sequence() converts sequence name directly to atom.
117
198
  - Parser level coreference resolution (neuralcoref) disabled by default, requires dedicated build.
118
199
 
119
200
  ## [0.4.2] - 12-04-2021
201
+
120
202
  ### Changed
203
+
121
204
  - Solving wheel compilation issue.
122
205
 
123
206
  ## [0.4.1] - 07-04-2021
207
+
124
208
  ### Changed
209
+
125
210
  - Solving issue with inclusion of auxiliary data file in non-binary distributions.
126
211
 
127
212
  ## [0.4.0] - 07-04-2021
213
+
128
214
  ### Added
215
+
129
216
  - Agents system.
130
217
  - Conjunctions resolution agent.
131
218
  - Number agent (singular/plural relations) and related meaning.number module.
@@ -140,7 +227,7 @@
140
227
  - Function Hypergraph.sequences().
141
228
  - Function Hyperedge.replace_argroles().
142
229
  - Function Hyperedge.insert_argrole().
143
- - Function Hyperedge.insert_edge_with_argrole().
230
+ - Function Hyperedge.add_argument().
144
231
  - Function Hyperedge.all_atoms().
145
232
  - Function Hyperedge.size().
146
233
  - Function Hyperedge.predicate().
@@ -150,6 +237,7 @@
150
237
  - Utility functions to show colored edges in the terminal.
151
238
 
152
239
  ### Changed
240
+
153
241
  - Special characters in atoms are now percent-encoded.
154
242
  - parse() now returns a dictionary that includes inferred edges.
155
243
  - parse() now returns a dictionary of edges to text.
@@ -165,25 +253,32 @@
165
253
  - Hyperedge.replace_atom() optional unique argument.
166
254
 
167
255
  ### Removed
256
+
168
257
  - Meta-modifier hyperedge type.
169
258
  - Auxiliary, subpredicate and dependency hyperedge types.
170
259
  - Obsolete Hyperedge.nest() method.
171
260
 
172
261
  ## [0.3.2] - 10-02-2020
262
+
173
263
  ### Added
264
+
174
265
  - simplify_role() on Atom objects produces an atom with only its simple type as role.
175
266
 
176
267
  ### Changed
268
+
177
269
  - Lemmas are now based on atoms with simplified roles.
178
270
  - Improved actors agent (more accurate identification of actors, English only for now).
179
271
 
180
272
  ## [0.3.1] - 03-02-2020
273
+
181
274
  ### Added
275
+
182
276
  - German parser (experimental and incomplete).
183
277
  - Documentation.
184
278
  - Hyperedge sequences.
185
279
 
186
280
  ### Changed
281
+
187
282
  - Improved hyperedge visualization in notebooks.
188
283
  - Agents receive language and sequence.
189
284
  - txt_parser agent creates a sequence.
@@ -192,11 +287,14 @@
192
287
  - Improved conflict agent.
193
288
 
194
289
  ## [0.3.0] - 28-09-2019
290
+
195
291
  ### Added
292
+
196
293
  - Tests.
197
294
  - Documentation.
198
295
 
199
296
  ### Changed
297
+
200
298
  - Graphbrain is now beta (main APIs considered stable).
201
299
  - LevelDB edge attributes encoded in JSON.
202
300
  - Renamed hypergraph() to hgraph() and moved function to __jnit__.
@@ -209,23 +307,29 @@
209
307
  - Improved notebooks visualizations (show(), blocks(), vblocks()).
210
308
 
211
309
  ### Removed
310
+
212
311
  - graphbrain.funs module.
213
312
 
214
313
  ## [0.2.2] - 13-09-2019
215
314
 
216
315
  ### Added
316
+
217
317
  - txt_parser agent.
218
318
  - MANIFEST.in to include VERSION file in distribution.
219
319
 
220
320
  ### Changed
321
+
221
322
  - Fixing 'pip install graphbrain' on Linux/Windows.
222
323
 
223
324
  ## [0.2.1] - 04-09-2019
325
+
224
326
  ### Added
327
+
225
328
  - claim_actors and corefs_dets agents.
226
329
  - meaning.concepts module.
227
330
 
228
331
  ### Changed
332
+
229
333
  - Fixed example.
230
334
  - hypergraph.sum_degree() and .sum_deep_degree().
231
335
  - Parser improvements.
@@ -233,11 +337,14 @@
233
337
  - Improved docs.
234
338
 
235
339
  ### Removed
340
+
236
341
  - Obsolete 'work-in-progress' code.
237
342
  - hg2json command.
238
343
 
239
344
  ## [0.2.0] - 04-08-2019
345
+
240
346
  ### Added
347
+
241
348
  - Primary entities and deep degrees.
242
349
  - Hyperedges have their own class, deriving from tuple.
243
350
  - Atoms have a special class, deriving from Hyperedge.
@@ -245,11 +352,15 @@
245
352
  - Created agent system + first agents.
246
353
 
247
354
  ### Changed
355
+
248
356
  - Parsers now have own package.
249
357
 
250
358
  ### Removed
359
+
251
360
  - Old experimental code.
252
361
 
253
362
  ## [0.1.0] - 14-06-2019
363
+
254
364
  ### Added
255
- - First release.
365
+
366
+ - First release.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperbase
3
- Version: 0.8.0
3
+ Version: 0.10.0
4
4
  Summary: A foundational library for Semantic Hypergraphs
5
5
  Project-URL: Homepage, https://hyperquest.ai/hyperbase
6
6
  Author-email: "Telmo Menezes et al." <telmo@telmomenezes.net>
@@ -16,13 +16,19 @@ Classifier: Programming Language :: Python :: 3
16
16
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
17
  Classifier: Topic :: Scientific/Engineering :: Information Analysis
18
18
  Requires-Python: >=3.10
19
+ Requires-Dist: mwparserfromhell>=0.7.2
20
+ Requires-Dist: prompt-toolkit>=3.0.0
21
+ Requires-Dist: rich>=13.0.0
19
22
  Requires-Dist: tqdm>=4.65.0
23
+ Requires-Dist: trafilatura>=2.0.0
20
24
  Provides-Extra: dev
25
+ Requires-Dist: click==8.2.1; extra == 'dev'
21
26
  Requires-Dist: coverage>=7.4.3; extra == 'dev'
22
27
  Requires-Dist: mkdocs-material>=9.5; extra == 'dev'
23
28
  Requires-Dist: mkdocstrings[python]>=0.24; extra == 'dev'
24
29
  Requires-Dist: mypy>=1.8.0; extra == 'dev'
25
30
  Requires-Dist: pre-commit>=3.6.2; extra == 'dev'
31
+ Requires-Dist: pytest>=9.0.0; extra == 'dev'
26
32
  Requires-Dist: ruff>=0.2.2; extra == 'dev'
27
33
  Requires-Dist: types-passlib>=1.7.7.20240106; extra == 'dev'
28
34
  Description-Content-Type: text/markdown
@@ -0,0 +1 @@
1
+ 0.10.0
@@ -0,0 +1,19 @@
1
+ /* hyperquest.ai brand colors */
2
+ :root,
3
+ [data-md-color-scheme="default"] {
4
+ --md-primary-fg-color: #f1fffb;
5
+ --md-primary-fg-color--light: #f2f9f8;
6
+ --md-primary-fg-color--dark: #c6dfd9;
7
+ --md-primary-bg-color: #45847D;
8
+ --md-accent-fg-color: #6bcf7f;
9
+ --md-typeset-a-color: #45847D;
10
+ }
11
+
12
+ [data-md-color-scheme="slate"] {
13
+ --md-primary-fg-color: #f1fffb;
14
+ --md-primary-fg-color--light: #f2f9f8;
15
+ --md-primary-fg-color--dark: #c6dfd9;
16
+ --md-primary-bg-color: #45847D;
17
+ --md-accent-fg-color: #6bcf7f;
18
+ --md-typeset-a-color: #45847D;
19
+ }
@@ -0,0 +1,141 @@
1
+ # Installation
2
+
3
+ Hyperbase requires Python >=3.10.
4
+
5
+ ## Install with pip
6
+
7
+ ```bash
8
+ pip install hyperbase
9
+ ```
10
+
11
+ ## Install with uv
12
+
13
+ [uv](https://docs.astral.sh/uv/) is a fast Python package manager. To add hyperbase to your project:
14
+
15
+ ```bash
16
+ uv add hyperbase
17
+ ```
18
+
19
+ Or to install it in a standalone environment:
20
+
21
+ ```bash
22
+ uv pip install hyperbase
23
+ ```
24
+
25
+ ## Install from source
26
+
27
+ Clone the repository and install:
28
+
29
+ ```bash
30
+ git clone https://github.com/hyperbase/hyperbase.git
31
+ cd hyperbase
32
+ pip install .
33
+ ```
34
+
35
+ Or using uv:
36
+
37
+ ```bash
38
+ git clone https://github.com/hyperbase/hyperbase.git
39
+ cd hyperbase
40
+ uv sync
41
+ ```
42
+
43
+ To run the tests from the project root:
44
+
45
+ ```bash
46
+ pytest
47
+ ```
48
+
49
+ Or using uv:
50
+
51
+ ```bash
52
+ uv run pytest
53
+ ```
54
+
55
+ ## Parsers
56
+
57
+ Hyperbase uses a plugin architecture for parsers. The core package does not include any parser, it only specifies the abstract parser interface. Parsers are installed separately as Python packages that register themselves via entry points.
58
+
59
+ | Package | Plugin name | Description | License |
60
+ | ------- | ----------- | ----------- | ------- |
61
+ | `hyperbase-parser-ab` | `alphabeta` | AlphaBeta parser using spaCy | Open source (MIT) |
62
+ | `hyperbase-parser-gen` | `generative` | Multilingual generative parser based on fine-tuned transformer model | Proprietary |
63
+
64
+ AlphaBeta is the "classical" parser developed for Semantic Hypergraphs. It is based on spaCy and depends on its language models, that have to be installed to support a given language. It is released under the same permissive open source license as hyperbase (MIT).
65
+
66
+ Generative is the "modern" multilingual parser, which produces high-quality parses for many languages. It is based on the fine-tuning of a more powerful transformer model and requires a GPU to run with acceptable speed. We plan on making this parser available for researchers and under a commercial license otherwise. Contact us if you are a researcher and wish to have early access to this parser.
67
+
68
+ ### Installing a parser
69
+
70
+ Install a parser with pip:
71
+
72
+ ```bash
73
+ pip install hyperbase-parser-ab
74
+ ```
75
+
76
+ Or with uv:
77
+
78
+ ```bash
79
+ uv add hyperbase-parser-ab
80
+ ```
81
+
82
+ ### AlphaBeta language support: installing spaCy models
83
+
84
+ For example, for English language support:
85
+
86
+ ```bash
87
+ python -m spacy download en_core_web_trf
88
+ ```
89
+
90
+ Or with uv:
91
+
92
+ ```bash
93
+ uv run python -m spacy download en_core_web_trf
94
+ ```
95
+
96
+ Replace with the appropriate model from the table below.
97
+
98
+ | Language | Code | Model |
99
+ | -------- | ---- | ----- |
100
+ | Chinese | `zh` | `zh_core_news_trf` |
101
+ | English | `en` | `en_core_web_trf` |
102
+ | French | `fr` | `fr_dep_news_trf` |
103
+ | German | `de` | `de_dep_news_trf` |
104
+ | Italy | `it` | `it_core_news_lg` |
105
+ | Portuguese | `pt` | `pt_core_news_lg` |
106
+ | Spanish | `es` | `es_dep_news_trf` |
107
+
108
+ The table shows the languages that are currently configured. In principle, any language for which a [spaCy model](https://spacy.io/models/) is available can be supported. If you are interested in adding a language and can verify accuracy, please add a pull request or open an issue in the [plugin's repository](https://github.com/hyperquest-hq/hyperbase-parser-ab).
109
+
110
+ ### Verifying installation
111
+
112
+ You can list all installed parsers with the CLI:
113
+
114
+ ```bash
115
+ hyperbase parsers
116
+ ```
117
+
118
+ ```bash
119
+ uv run hyperbase parsers
120
+ ```
121
+
122
+ ### Using parsers
123
+
124
+ Once installed, parsers can be used from the interactive REPL:
125
+
126
+ ```bash
127
+ hyperbase repl --parser alphabeta --lang en
128
+ ```
129
+
130
+ ```bash
131
+ uv run hyperbase repl --parser alphabeta --lang en
132
+ ```
133
+
134
+ Or programmatically:
135
+
136
+ ```python
137
+ from hyperbase.parsers import get_parser
138
+
139
+ parser = get_parser("alphabeta", lang="en")
140
+ result = parser.parse_text("The sky is blue.")
141
+ ```
@@ -8,14 +8,6 @@
8
8
 
9
9
  ::: hyperbase.hyperedge
10
10
 
11
- ## Patterns module
12
-
13
- ::: hyperbase.patterns
14
-
15
- ## Parsers package
11
+ ## Parsers module
16
12
 
17
13
  ::: hyperbase.parsers
18
-
19
- ### Parser module
20
-
21
- ::: hyperbase.parsers.parser