Sync from GitHub: 32807617773d0b0764947d4d4aa06376b7385c12
Browse files- app.py +8 -5
- nuwave/concept_helper.py +7 -1
app.py
CHANGED
|
@@ -352,12 +352,15 @@ def _hardened_parse(raw_output: str) -> list:
|
|
| 352 |
# portion, because small LLMs echo instruction vocabulary back as
|
| 353 |
# output content.
|
| 354 |
_EXTRACTOR_PROMPT_TEMPLATE = (
|
| 355 |
-
"Read the following text
|
| 356 |
-
"
|
| 357 |
-
"
|
| 358 |
-
"
|
|
|
|
|
|
|
|
|
|
| 359 |
"Text: {text}\n\n"
|
| 360 |
-
"
|
| 361 |
)
|
| 362 |
|
| 363 |
|
|
|
|
| 352 |
# portion, because small LLMs echo instruction vocabulary back as
|
| 353 |
# output content.
|
| 354 |
_EXTRACTOR_PROMPT_TEMPLATE = (
|
| 355 |
+
"Read the following text. Extract the specific mechanisms, "
|
| 356 |
+
"operations, and relationships it establishes — the things the "
|
| 357 |
+
"text says happen, connect, or depend on each other. Prefer "
|
| 358 |
+
"specific over general: 'prime factorization' not 'number theory', "
|
| 359 |
+
"'membrane depolarization' not 'biology'. Output as a comma-"
|
| 360 |
+
"separated enumeration. Each item 1-4 words. No sentences, no "
|
| 361 |
+
"explanations, no repetition.\n\n"
|
| 362 |
"Text: {text}\n\n"
|
| 363 |
+
"Mechanisms:"
|
| 364 |
)
|
| 365 |
|
| 366 |
|
nuwave/concept_helper.py
CHANGED
|
@@ -190,7 +190,13 @@ class ConceptWorker:
|
|
| 190 |
self._organism._embeddings[tree_id] = tree_emb
|
| 191 |
self._organism._node_content[tree_id] = concept
|
| 192 |
|
| 193 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
# STDP in the next step() will reinforce whichever
|
| 195 |
# direction co-fires more reliably.
|
| 196 |
try:
|
|
|
|
| 190 |
self._organism._embeddings[tree_id] = tree_emb
|
| 191 |
self._organism._node_content[tree_id] = concept
|
| 192 |
|
| 193 |
+
# Register tree in the amplitude field so it participates
|
| 194 |
+
# in the same decay/boost dynamics as forest nodes.
|
| 195 |
+
# Without this the tree is invisible to the step() decay
|
| 196 |
+
# loop and jumps discontinuously from implicit 0.5 → 0.9
|
| 197 |
+
# on its first fire. 0.5 initial < forest's 1.0 because
|
| 198 |
+
# a tree is an extracted fragment with less context.
|
| 199 |
+
self._organism._amplitudes[tree_id] = 0.5
|
| 200 |
# STDP in the next step() will reinforce whichever
|
| 201 |
# direction co-fires more reliably.
|
| 202 |
try:
|