-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
129 lines (108 loc) · 2.54 KB
/
__init__.py
File metadata and controls
129 lines (108 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
"""
Novelty - Measuring deviation from reference frames.
Novelty is not a property of concepts in isolation. It is the result of
a loop that measures how a concept relates to an agent's existing beliefs.
The termination reason IS the novelty measurement.
Key exports for integration with attention:
from novelty import (
# Core types
NoveltyResult,
Termination,
Stance,
ReferenceFrame,
# Probes (the measurement loop)
HybridProbe,
NeuralProbe,
# Frames (what you measure against)
HybridFrame,
NeuralFrame,
# Convenience functions
measure_against_claims,
measure_hybrid_novelty,
)
Quick usage:
from novelty import measure_against_claims
result = measure_against_claims(
concept="Bitcoin",
claim_texts=[
"Traditional banking provides security",
"Trust in institutions is necessary",
]
)
print(result.termination) # Termination.CONTRADICTS_ROOT
print(result.composite) # 0.052 (novelty score 0-1)
"""
# Core types
from .core import (
NoveltyProbe,
ReferenceFrame,
Focus,
ParseResult,
Termination,
Stance,
Claim,
NoveltyResult,
)
# Hybrid probe (Wikidata graph + Neural NLI)
from .hybrid_probe import (
HybridProbe,
HybridFrame,
HybridClaim,
HybridFetchResult,
measure_hybrid_novelty,
measure_against_claims,
)
# Neural probe (pure NLI, no Wikidata)
from .neural_probe import (
NeuralProbe,
NeuralFrame,
NeuralClaim,
measure_neural_novelty,
)
# Wikidata probe (graph structure only)
from .wikidata_probe import (
WikidataProbe,
WikidataFrame,
WikidataClaim,
measure_novelty as measure_wikidata_novelty,
)
# Embeddings utilities (for direct use)
from .embeddings import (
semantic_similarity,
cached_similarity,
nli_inference,
NLIResult,
)
__version__ = "0.1.0"
__all__ = [
# Core
"NoveltyProbe",
"ReferenceFrame",
"Focus",
"ParseResult",
"Termination",
"Stance",
"Claim",
"NoveltyResult",
# Hybrid (recommended)
"HybridProbe",
"HybridFrame",
"HybridClaim",
"measure_hybrid_novelty",
"measure_against_claims",
# Neural
"NeuralProbe",
"NeuralFrame",
"NeuralClaim",
"measure_neural_novelty",
# Wikidata
"WikidataProbe",
"WikidataFrame",
"WikidataClaim",
"measure_wikidata_novelty",
# Utilities
"semantic_similarity",
"cached_similarity",
"nli_inference",
"NLIResult",
]