hyperbase

hyperquest-hqMIT活跃维护

用 Python 实现语义超图的基础库,把知识表示成可计算的超图结构,适合做知识库、认知建模和自然语言理解等需要表达多元关系的场景。

A foundational library for Semantic Hypergraphs

v0.10.0发布于 2026-04-11 14:54 UTC651star76fork同步于 2026-11-10 06:00 UTC

怎么上手

README 里没有找到可直接复制的安装命令

README 里没有找到可直接复制的安装命令,请到 README 或官方文档查看安装方式。

硬件要求

README 没有说明硬件要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

这个项目的说明还在生成中,先参考下面「最近发版」和 README。

最近发版

5 个版本v0.10.0
  1. v0.10.0最新正式版2026-04-11 · 2026-04-11 14:54 UTC

    [0.10.0] - 11-04-2026

    Added

    • [] pattern notation for specifying sequences of arguments.
    • EdgeType and ArgRole enums.
    • safety cap for match (_MAX_ARGROLE_ITEMS=10) against pathological edge arities.
    • caching of computed Hyperedge/Atom properties.
    • parse_to_jsonl method on Parser.
    • unified parameter interface for parsers.
    • method Parser.accepted_params.
    • maximum depth protection for parsers.
    • repl api for parsers.

    Changed

    • multiple patterns functions are now Hyperedge/Atom methods: is_wildcard, is_pattern, is_fun_pattern, is_variable, contains_variable, variable_name.
    • hyperbase.py now delegating to smaller modules with well-defined concerns: builders.py, correctness.py, transforms.py, patterns.checks.py and patterns.matcher.py.
    • replaced itertools.permutations with constraint-propagated backtracking in argrole matcher.
    • parse_text renamed to parse; old iterator-based parse removed.
    • read_source renamed to parse_source; read_source_to_jsonl renamed to parse_source_to_jsonl.
    • renamed sentensize to get_sentences.
    • hedge now uses an explicit stack instead of recursion (so that pathologically nested edge strings cannot exhaust Python's call stack).
    • renamed parsers.correctness to parsers.badness.

    Removed

    • __add__ operator overloading in Hyperedge/Atom.
  2. v0.9.02026-04-05 · 2026-04-05 10:42 UTC
    查看更新说明

    Changelog

    [0.9.0] - 05-04-2026

    Added

    • readers (txt, url, wikipedia).
    • cli interface with repl, parsers, readers.
    • hyperedge.Hyperedge.match function (calls parsers.match_pattern).
    • ParseResults.
    • HyperEdge.text.
    • load_edges function.

    Changed

    • added get_parser to main functions (at hyperbase root).
    • improved documentation.
    • hedge now accepts ParseResults and can recursively add Hyperedge.text strings.
    • renamed function hyperedge.str2atom to str_to_atom.
    • Hyperedge is not a frozen dataclasse, instead of inheriting from tuple.
    • hedge now throws exceptions instead of returning None values.
    • Hyperedge.contains always recursive, removed deep argument.
    • simplified Hyperedge.simplify.
    • Hyperedge.insert_argrole now private, renamed to Hyperedge._insert_argrole.
    • Renamed Hyperedge.insert_edge_with_argrole to add_argument, pos optional (default to add at the end).
    • Renamed Hyperedge.edges_with_argrole to arguments_with_role.
    • Renamed Hyperedge.normalized to normalise.

    Removed

    • function patterns.edge_matches_pattern.
    • 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.
  3. v0.8.02026-03-26 · 2026-03-26 18:10 UTC
    查看更新说明

    [0.8.0] - 26-03-2026 - hyperbase is the successor of graphbrain

    Added

    • parser plugin foundation.
    • more comprehensive Hyperedge.check_correctness.
    • check parse correctness.
    • type checking: full code coverage.

    Changed

    • renamed library to hyperbase.
    • trimmed down library to the essentials: hyperedge, patterns and parser foundations.
    • converted documentation to Material for MkDocs.

    Removed

    • hypergraph module, hypergraph database (memory module).
    • alphabeta parser implementation.
    • old scripts, examples, processors.
    • ad hoc utils.
    • cli.
    • notebook utils.
    • obsolete constants.
  4. v0.7.02026-03-26 · 2026-03-26 07:41 UTC
    查看更新说明

    Added

    • patterns.is_wildcard().
    • Base class hypergraph.memory.keyvalue.KeyValue for key-value hypergraph databases, removing redundant code between LevelDB and SQLite.
    • Tests for LevelDB (only the SQLite Hypergraph implementation was being directly tested).
    • Hyperedge.is_unordered_pattern().
    • Functional pattern: any.
    • Parser-level inference of coreferences between proper nouns.
    • Parser.parse_and_add() now adds token information to the main edge of a sentence: the attribute 'tokens' contains the list of tokens and 'tok_pos' a structure with the token position for each atom in the edge.
    • Post-processing step improves parser.
    • Hypergraph.get_attributes().

    Changed

    • Entire project is now in pure Python
    • Python >=3.10 now required.
    • Hypergraph.search(), .match() and .count() now working with functional patterns and argument role matching.
    • Fixed bug on match_pattern(), variables were not correctly matched when argument roles were specified past the first position in an atoms functional pattern.
    • Simplified default systems connectors (breaks hypergraph DB backwards compatibility).
    • max_text argument in parser.parse_and_add().
    • Matches from patterns with repeated variables are collected in lists.

    Removed

    • graphbrain.logic obsolete module.
    • LevelDB backend
  5. v0.6.1Version 0.6.12022-10-31 · 2022-10-31 07:31 UTC
    查看更新说明

    Changed

    • Hyperedge.replace_argroles() .insert_argrole() and .insert_edge_with_argrole() now works with functional patterns such as var.
    • Fixed bug when matching patterns containing atoms functional pattern where no atom has argroles.

    Removed

    • interactive_case_generator() from graphbrain.notebook.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Hyperbase

    A foundational library for Semantic Hypergraphs

    Hyperbase is a foundational library for working with Semantic Hypergraphs (SH), which make it possible to represent a natural language sentence such as "Einstein first published the theory of relativity in 1905" as an ordered, recursive hyperlink of the form:

    Hyperbase is written in Python, to both take advantage and facilitate integration with the rich environment of scientific libraries available in this language. It is released under the highly permissive MIT open source license.

    Installation and manual

    Installation instructions, the manual and more information can be found here: https://hyperquest.ai/hyperbase

    Contributing

    Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

    Please make sure to update tests as appropriate.

    Funding

    The creation of this software library and the associated research that made it possible were funded by CNRS and the ERC Consolidator Grant Socsemics (grant #772743).

    License

    MIT