Commit ·
15c3265
1
Parent(s): 263823e
upload to huggingface (exclude binary indexes)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitignore +7 -0
- README.md +82 -0
- README_zh.md +82 -0
- data/indexes/facts.jsonl +0 -0
- data/indexes/persona.jsonl +448 -0
- data/indexes/worldview.jsonl +510 -0
- data/processed/chunks.jsonl +0 -0
- data/processed/dialogues.jsonl +0 -0
- data/processed/persona_Hyde.json +57 -0
- data/processed/persona_Hyde_prompt.txt +14 -0
- data/processed/persona_Jekyll.json +58 -0
- data/processed/persona_Jekyll_prompt.txt +14 -0
- data/processed/persona_Poole.json +58 -0
- data/processed/persona_Poole_prompt.txt +14 -0
- data/processed/persona_Utterson.json +58 -0
- data/processed/persona_Utterson_prompt.txt +14 -0
- data/processed/worldview_notes.jsonl +510 -0
- data/raw/The Strange Case of Dr. Jekyll and Mr. Hyde.txt +0 -0
- data/raw/cinderella.txt +239 -0
- pyproject.toml +24 -0
- scripts/build_indexes.py +71 -0
- scripts/eval_answer.py +38 -0
- scripts/run_meta_qa.py +63 -0
- scripts/run_pipeline.py +244 -0
- scripts/run_retrieve_compose.py +36 -0
- scripts/upload_to_hf.sh +216 -0
- src/fic_agent.egg-info/PKG-INFO +45 -0
- src/fic_agent.egg-info/SOURCES.txt +25 -0
- src/fic_agent.egg-info/dependency_links.txt +1 -0
- src/fic_agent.egg-info/requires.txt +6 -0
- src/fic_agent.egg-info/top_level.txt +1 -0
- src/fic_agent/__init__.py +1 -0
- src/fic_agent/config.py +80 -0
- src/fic_agent/eval/__init__.py +0 -0
- src/fic_agent/eval/judge.py +121 -0
- src/fic_agent/generation/__init__.py +0 -0
- src/fic_agent/generation/compose.py +236 -0
- src/fic_agent/generation/meta_loop.py +269 -0
- src/fic_agent/ingest/__init__.py +0 -0
- src/fic_agent/ingest/pipeline.py +494 -0
- src/fic_agent/persona/__init__.py +0 -0
- src/fic_agent/persona/profile.py +443 -0
- src/fic_agent/persona/templates/persona_prompt.txt +14 -0
- src/fic_agent/retrieval/__init__.py +0 -0
- src/fic_agent/retrieval/embeddings.py +56 -0
- src/fic_agent/retrieval/retriever.py +572 -0
- src/fic_agent/retrieval/vector_store.py +97 -0
- src/fic_agent/utils/__init__.py +0 -0
- src/fic_agent/utils/io.py +12 -0
- src/fic_agent/worldview/__init__.py +0 -0
.gitignore
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__/
|
| 2 |
+
*.pyc
|
| 3 |
+
.env
|
| 4 |
+
outputs/
|
| 5 |
+
|
| 6 |
+
*.faiss
|
| 7 |
+
data/indexes/*.faiss
|
README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# fic-agent
|
| 2 |
+
|
| 3 |
+
A no-finetune, retrieval-augmented character chatbot for fiction.
|
| 4 |
+
|
| 5 |
+
## Goals
|
| 6 |
+
- Factual consistency with the source text
|
| 7 |
+
- Character-true language style and emotional profile
|
| 8 |
+
- Worldview consistency (settings, rules, relationships)
|
| 9 |
+
|
| 10 |
+
## Repository layout
|
| 11 |
+
- `configs/` Runtime configs (API keys, model names, flags)
|
| 12 |
+
- `data/raw/` Raw novels and metadata
|
| 13 |
+
- `data/processed/` Chunked text, extracted dialogues, persona notes
|
| 14 |
+
- `data/indexes/` Vector indexes and graph artifacts
|
| 15 |
+
- `data/eval/` Evaluation inputs and references
|
| 16 |
+
- `outputs/` Run outputs and logs
|
| 17 |
+
- `scripts/` CLI helpers and pipelines
|
| 18 |
+
- `src/fic_agent/` Core library
|
| 19 |
+
|
| 20 |
+
## Core pipeline (high level)
|
| 21 |
+
1. Ingest raw text
|
| 22 |
+
2. Extract character dialogue + context
|
| 23 |
+
3. Build persona profile (style, affect, worldview)
|
| 24 |
+
4. Build fact and worldview indexes
|
| 25 |
+
5. Retrieve relevant evidence + persona
|
| 26 |
+
6. Generate response with persona-conditioned prompt
|
| 27 |
+
7. Evaluate (facts, style, worldview)
|
| 28 |
+
|
| 29 |
+
## End-to-End Run (Dataset -> Question -> Answer)
|
| 30 |
+
1. Activate environment and install dependencies.
|
| 31 |
+
```bash
|
| 32 |
+
conda activate fic_agent
|
| 33 |
+
cd /home/tleautomat/Project/fic-agent
|
| 34 |
+
python -m pip install -r requirements.txt
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
2. Set API keys (OpenRouter key can be reused for LLM and embeddings).
|
| 38 |
+
```bash
|
| 39 |
+
export OPENROUTER_API_KEY="your_key"
|
| 40 |
+
export OPENAI_API_KEY="$OPENROUTER_API_KEY"
|
| 41 |
+
export EMBEDDING_API_KEY="$OPENROUTER_API_KEY"
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
3. Put your novel text in `data/raw/` (example already included).
|
| 45 |
+
|
| 46 |
+
4. Run preprocessing + memory building + index building.
|
| 47 |
+
```bash
|
| 48 |
+
python scripts/run_pipeline.py \
|
| 49 |
+
--input "data/raw/The Strange Case of Dr. Jekyll and Mr. Hyde.txt" \
|
| 50 |
+
--book-id jekyll_hyde \
|
| 51 |
+
--characters "Jekyll,Hyde,Utterson,Poole" \
|
| 52 |
+
--all-characters \
|
| 53 |
+
--worldview-llm \
|
| 54 |
+
--build-index
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
5. Ask a user question with the meta-cognitive QA loop.
|
| 58 |
+
```bash
|
| 59 |
+
python scripts/run_meta_qa.py \
|
| 60 |
+
--query "As Utterson, should you trust Hyde after the trampling incident?" \
|
| 61 |
+
--character Utterson \
|
| 62 |
+
--max-iter 3 \
|
| 63 |
+
--style-correct \
|
| 64 |
+
--dump-trace \
|
| 65 |
+
--save-json outputs/qa/utterson_q1.json
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
6. (Optional) Evaluate one generated answer.
|
| 69 |
+
```bash
|
| 70 |
+
python scripts/eval_answer.py \
|
| 71 |
+
--result-json outputs/qa/utterson_q1.json \
|
| 72 |
+
--character Utterson \
|
| 73 |
+
--processed-dir data/processed
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
## Main Outputs
|
| 77 |
+
- `data/processed/chunks.jsonl`: document chunks
|
| 78 |
+
- `data/processed/dialogues.jsonl`: extracted dialogues with speaker guesses
|
| 79 |
+
- `data/processed/persona_*.json`: persona profiles per character
|
| 80 |
+
- `data/processed/worldview_notes.jsonl`: worldview memory notes
|
| 81 |
+
- `data/indexes/*.faiss` and `data/indexes/*.jsonl`: vector indexes + metadata
|
| 82 |
+
- `outputs/qa/*.json`: final answer, loop trace, merged evidence
|
README_zh.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# fic-agent
|
| 2 |
+
|
| 3 |
+
一个**无需微调**、基于检索增强(RAG)的小说角色聊天系统。
|
| 4 |
+
|
| 5 |
+
## 目标
|
| 6 |
+
- 与原文事实保持一致
|
| 7 |
+
- 保持角色语言风格与情感特征一致
|
| 8 |
+
- 与世界观设定(规则、关系、场景)保持一致
|
| 9 |
+
|
| 10 |
+
## 仓库结构
|
| 11 |
+
- `configs/` 运行配置(API Key、模型名、开关)
|
| 12 |
+
- `data/raw/` 原始小说文本与元数据
|
| 13 |
+
- `data/processed/` 切块结果、对话抽取结果、角色画像
|
| 14 |
+
- `data/indexes/` 向量索引与对应元数据
|
| 15 |
+
- `data/eval/` 评测输入与参考数据
|
| 16 |
+
- `outputs/` 运行输出与日志
|
| 17 |
+
- `scripts/` 命令行脚本
|
| 18 |
+
- `src/fic_agent/` 核心代码
|
| 19 |
+
|
| 20 |
+
## 核心流程(高层)
|
| 21 |
+
1. 读取原文并切块
|
| 22 |
+
2. 抽取角色对话与上下文
|
| 23 |
+
3. 构建角色画像(风格/情绪/价值观/世界观)
|
| 24 |
+
4. 构建事实与世界观索引
|
| 25 |
+
5. 检索相关证据(Tri-Retrieve)
|
| 26 |
+
6. 结合角色画像生成回答(事实优先)
|
| 27 |
+
7. 评估(事实/风格/世界观)
|
| 28 |
+
|
| 29 |
+
## 端到端跑通(数据集 -> 问题 -> 回答)
|
| 30 |
+
1. 激活环境并安装依赖
|
| 31 |
+
```bash
|
| 32 |
+
conda activate fic_agent
|
| 33 |
+
cd /home/tleautomat/Project/fic-agent
|
| 34 |
+
python -m pip install -r requirements.txt
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
2. 配置 API Key(OpenRouter 的 key 可同时用于 LLM 和 Embedding)
|
| 38 |
+
```bash
|
| 39 |
+
export OPENROUTER_API_KEY="你的key"
|
| 40 |
+
export OPENAI_API_KEY="$OPENROUTER_API_KEY"
|
| 41 |
+
export EMBEDDING_API_KEY="$OPENROUTER_API_KEY"
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
3. 将小说文本放入 `data/raw/`(示例文件已包含)
|
| 45 |
+
|
| 46 |
+
4. 执行预处理 + 三层记忆构建 + 建索引
|
| 47 |
+
```bash
|
| 48 |
+
python scripts/run_pipeline.py \
|
| 49 |
+
--input "data/raw/The Strange Case of Dr. Jekyll and Mr. Hyde.txt" \
|
| 50 |
+
--book-id jekyll_hyde \
|
| 51 |
+
--characters "Jekyll,Hyde,Utterson,Poole" \
|
| 52 |
+
--all-characters \
|
| 53 |
+
--worldview-llm \
|
| 54 |
+
--build-index
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
5. 输入用户问题并执行元认知问答循环
|
| 58 |
+
```bash
|
| 59 |
+
python scripts/run_meta_qa.py \
|
| 60 |
+
--query "As Utterson, should you trust Hyde after the trampling incident?" \
|
| 61 |
+
--character Utterson \
|
| 62 |
+
--max-iter 3 \
|
| 63 |
+
--style-correct \
|
| 64 |
+
--dump-trace \
|
| 65 |
+
--save-json outputs/qa/utterson_q1.json
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
6.(可选)对单条回答进行自动评估
|
| 69 |
+
```bash
|
| 70 |
+
python scripts/eval_answer.py \
|
| 71 |
+
--result-json outputs/qa/utterson_q1.json \
|
| 72 |
+
--character Utterson \
|
| 73 |
+
--processed-dir data/processed
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
## 主要输出文件
|
| 77 |
+
- `data/processed/chunks.jsonl`:文档切块结果
|
| 78 |
+
- `data/processed/dialogues.jsonl`:对话与说话人识别结果
|
| 79 |
+
- `data/processed/persona_*.json`:角色画像
|
| 80 |
+
- `data/processed/worldview_notes.jsonl`:世界观记忆
|
| 81 |
+
- `data/indexes/*.faiss` 与 `data/indexes/*.jsonl`:向量索引与元数据
|
| 82 |
+
- `outputs/qa/*.json`:最终回答、循环轨迹、合并证据池
|
data/indexes/facts.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/indexes/persona.jsonl
ADDED
|
@@ -0,0 +1,448 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "dlg-0", "text": "I incline to\nCain’s heresy,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-0"}
|
| 2 |
+
{"id": "dlg-1", "text": "I let my brother go to the\ndevil in his own way.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-0"}
|
| 3 |
+
{"id": "dlg-2", "text": "Did you ever remark that door?", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-2"}
|
| 4 |
+
{"id": "dlg-3", "text": "It is connected in my mind,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-2"}
|
| 5 |
+
{"id": "dlg-4", "text": "with a very odd story.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-2"}
|
| 6 |
+
{"id": "dlg-5", "text": "Indeed?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-2"}
|
| 7 |
+
{"id": "dlg-6", "text": "and what\nwas that?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-2"}
|
| 8 |
+
{"id": "dlg-7", "text": "Well, it was this way,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-2"}
|
| 9 |
+
{"id": "dlg-8", "text": "Tut-tut!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-4"}
|
| 10 |
+
{"id": "dlg-9", "text": "I see you feel as I do,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-4"}
|
| 11 |
+
{"id": "dlg-10", "text": "And\nyou don’t know if the drawer of the cheque lives there?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-5"}
|
| 12 |
+
{"id": "dlg-11", "text": "A likely place, isn’t it?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-5"}
|
| 13 |
+
{"id": "dlg-12", "text": "But I happen to have\nnoticed his address; he lives in some square or other.", "speaker": null, "chunk_id": "jekyll_hyde-5"}
|
| 14 |
+
{"id": "dlg-13", "text": "And you never asked about the—place with the door?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-5"}
|
| 15 |
+
{"id": "dlg-14", "text": "No, sir; I had a delicacy,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-5"}
|
| 16 |
+
{"id": "dlg-15", "text": "A very good rule, too,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-5"}
|
| 17 |
+
{"id": "dlg-16", "text": "But I have studied the place for myself,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-5"}
|
| 18 |
+
{"id": "dlg-17", "text": "Enfield,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-5"}
|
| 19 |
+
{"id": "dlg-18", "text": "that’s a good rule of yours.", "speaker": null, "chunk_id": "jekyll_hyde-5"}
|
| 20 |
+
{"id": "dlg-19", "text": "Yes, I think it is,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-5"}
|
| 21 |
+
{"id": "dlg-20", "text": "But for all that,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-5"}
|
| 22 |
+
{"id": "dlg-21", "text": "Enfield,", "speaker": null, "chunk_id": "jekyll_hyde-6"}
|
| 23 |
+
{"id": "dlg-22", "text": "that’s a good rule of yours.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 24 |
+
{"id": "dlg-23", "text": "Yes, I think it is,", "speaker": null, "chunk_id": "jekyll_hyde-6"}
|
| 25 |
+
{"id": "dlg-24", "text": "But for all that,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 26 |
+
{"id": "dlg-25", "text": "there’s one point I want to\nask. I want to ask the name of that man who walked over the child.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 27 |
+
{"id": "dlg-26", "text": "Well,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 28 |
+
{"id": "dlg-27", "text": "I can’t see what harm it would do. It was a\nman of the name of Hyde.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 29 |
+
{"id": "dlg-28", "text": "Hm,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 30 |
+
{"id": "dlg-29", "text": "What sort of a man is he to see?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 31 |
+
{"id": "dlg-30", "text": "You are sure he used a key?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 32 |
+
{"id": "dlg-31", "text": "My dear sir...", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 33 |
+
{"id": "dlg-32", "text": "Yes, I know,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 34 |
+
{"id": "dlg-33", "text": "I know it must seem strange. The fact\nis, if I do not ask you the name of the other party, it is because I\nknow it already. You see, Richard, your tale has gone home. If you have\nbeen inexact in any point you had better correct it.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 35 |
+
{"id": "dlg-34", "text": "I think you might have warned me,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 36 |
+
{"id": "dlg-35", "text": "But I have been pedantically exact, as you call it. The\nfellow had a key; and what’s more, he has it still. I saw him use it\nnot a week ago.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 37 |
+
{"id": "dlg-36", "text": "Here is another lesson to say nothing,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 38 |
+
{"id": "dlg-37", "text": "I\nam ashamed of my long tongue. Let us make a bargain never to refer to\nthis again.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 39 |
+
{"id": "dlg-38", "text": "With all my heart,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 40 |
+
{"id": "dlg-39", "text": "I shake hands on that, Richard.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-6"}
|
| 41 |
+
{"id": "dlg-40", "text": "friend and benefactor Edward Hyde,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-7"}
|
| 42 |
+
{"id": "dlg-41", "text": "disappearance or unexplained absence for any period exceeding\nthree calendar months,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-7"}
|
| 43 |
+
{"id": "dlg-42", "text": "I thought it was madness,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-7"}
|
| 44 |
+
{"id": "dlg-43", "text": "I thought it was madness,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-8"}
|
| 45 |
+
{"id": "dlg-44", "text": "and now I begin to fear it is disgrace.", "speaker": "Hyde", "chunk_id": "jekyll_hyde-8"}
|
| 46 |
+
{"id": "dlg-45", "text": "If anyone knows, it will be Lanyon,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-8"}
|
| 47 |
+
{"id": "dlg-46", "text": "I suppose, Lanyon,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-8"}
|
| 48 |
+
{"id": "dlg-47", "text": "you and I must be the two oldest friends\nthat Henry Jekyll has?", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-8"}
|
| 49 |
+
{"id": "dlg-48", "text": "I wish the friends were younger,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-8"}
|
| 50 |
+
{"id": "dlg-49", "text": "But I suppose\nwe are. And what of that? I see little of him now.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-8"}
|
| 51 |
+
{"id": "dlg-50", "text": "Indeed?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-8"}
|
| 52 |
+
{"id": "dlg-51", "text": "I thought you had a bond of common interest.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-8"}
|
| 53 |
+
{"id": "dlg-52", "text": "We had,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-8"}
|
| 54 |
+
{"id": "dlg-53", "text": "would have estranged Damon and Pythias.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-9"}
|
| 55 |
+
{"id": "dlg-54", "text": "They have only differed on some point of science,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-9"}
|
| 56 |
+
{"id": "dlg-55", "text": "It is nothing worse than that!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-9"}
|
| 57 |
+
{"id": "dlg-56", "text": "Did you ever come across a _protégé_\nof his—one Hyde?", "speaker": "Hyde", "chunk_id": "jekyll_hyde-9"}
|
| 58 |
+
{"id": "dlg-57", "text": "Hyde?", "speaker": "Hyde", "chunk_id": "jekyll_hyde-9"}
|
| 59 |
+
{"id": "dlg-58", "text": "No. Never heard of him. Since my time.", "speaker": "Hyde", "chunk_id": "jekyll_hyde-9"}
|
| 60 |
+
{"id": "dlg-59", "text": "If he be Mr. Hyde,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-10"}
|
| 61 |
+
{"id": "dlg-60", "text": "I shall be Mr. Seek.", "speaker": "Hyde", "chunk_id": "jekyll_hyde-10"}
|
| 62 |
+
{"id": "dlg-61", "text": "If he be Mr. Hyde,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-11"}
|
| 63 |
+
{"id": "dlg-62", "text": "I shall be Mr. Seek.", "speaker": "Hyde", "chunk_id": "jekyll_hyde-11"}
|
| 64 |
+
{"id": "dlg-63", "text": "Mr. Hyde, I think?", "speaker": "Hyde", "chunk_id": "jekyll_hyde-11"}
|
| 65 |
+
{"id": "dlg-64", "text": "That is my name. What do you want?", "speaker": "Hyde", "chunk_id": "jekyll_hyde-11"}
|
| 66 |
+
{"id": "dlg-65", "text": "I see you are going in,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-11"}
|
| 67 |
+
{"id": "dlg-66", "text": "That is my name. What do you want?", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 68 |
+
{"id": "dlg-67", "text": "I see you are going in,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 69 |
+
{"id": "dlg-68", "text": "I am an old friend of\nDr. Jekyll’s—Mr. Utterson of Gaunt Street—you must have heard of my\nname; and meeting you so conveniently, I thought you might admit me.", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 70 |
+
{"id": "dlg-69", "text": "You will not find Dr. Jekyll; he is from home,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 71 |
+
{"id": "dlg-70", "text": "How did you know me?", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 72 |
+
{"id": "dlg-71", "text": "On your side,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 73 |
+
{"id": "dlg-72", "text": "will you do me a favour?", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 74 |
+
{"id": "dlg-73", "text": "With pleasure,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 75 |
+
{"id": "dlg-74", "text": "What shall it be?", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 76 |
+
{"id": "dlg-75", "text": "Will you let me see your face?", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 77 |
+
{"id": "dlg-76", "text": "Now I shall know you\nagain,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 78 |
+
{"id": "dlg-77", "text": "It may be useful.", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 79 |
+
{"id": "dlg-78", "text": "Yes,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 80 |
+
{"id": "dlg-79", "text": "it is as well we have met; and _à propos_,\nyou should have my address.", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 81 |
+
{"id": "dlg-80", "text": "Good God!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-12"}
|
| 82 |
+
{"id": "dlg-81", "text": "can he, too, have been thinking of\nthe will?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-12"}
|
| 83 |
+
{"id": "dlg-82", "text": "And now,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-12"}
|
| 84 |
+
{"id": "dlg-83", "text": "how did you know me?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-12"}
|
| 85 |
+
{"id": "dlg-84", "text": "By description,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 86 |
+
{"id": "dlg-85", "text": "Whose description?", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 87 |
+
{"id": "dlg-86", "text": "We have common friends,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-12"}
|
| 88 |
+
{"id": "dlg-87", "text": "Common friends,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-12"}
|
| 89 |
+
{"id": "dlg-88", "text": "Who are they?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-12"}
|
| 90 |
+
{"id": "dlg-89", "text": "Jekyll, for instance,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-12"}
|
| 91 |
+
{"id": "dlg-90", "text": "He never told you,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 92 |
+
{"id": "dlg-91", "text": "I did not\nthink you would have lied.", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 93 |
+
{"id": "dlg-92", "text": "Come,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 94 |
+
{"id": "dlg-93", "text": "that is not fitting language.", "speaker": "Hyde", "chunk_id": "jekyll_hyde-12"}
|
| 95 |
+
{"id": "dlg-94", "text": "There\nmust be something else,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-13"}
|
| 96 |
+
{"id": "dlg-95", "text": "Is Dr. Jekyll at home, Poole?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-13"}
|
| 97 |
+
{"id": "dlg-96", "text": "I will see, Mr. Utterson,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-13"}
|
| 98 |
+
{"id": "dlg-97", "text": "Is Dr. Jekyll at home, Poole?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 99 |
+
{"id": "dlg-98", "text": "I will see, Mr. Utterson,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 100 |
+
{"id": "dlg-99", "text": "Will you wait here by the\nfire, sir? or shall I give you a light in the dining-room?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 101 |
+
{"id": "dlg-100", "text": "Here, thank you,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 102 |
+
{"id": "dlg-101", "text": "I saw Mr. Hyde go in by the old dissecting room, Poole,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 103 |
+
{"id": "dlg-102", "text": "Is\nthat right, when Dr. Jekyll is from home?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 104 |
+
{"id": "dlg-103", "text": "Quite right, Mr. Utterson, sir,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 105 |
+
{"id": "dlg-104", "text": "Mr. Hyde has a\nkey.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 106 |
+
{"id": "dlg-105", "text": "Your master seems to repose a great deal of trust in that young man,\nPoole,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 107 |
+
{"id": "dlg-106", "text": "Yes, sir, he does indeed,", "speaker": "Poole", "chunk_id": "jekyll_hyde-14"}
|
| 108 |
+
{"id": "dlg-107", "text": "We have all orders to obey\nhim.", "speaker": "Poole", "chunk_id": "jekyll_hyde-14"}
|
| 109 |
+
{"id": "dlg-108", "text": "I do not think I ever met Mr. Hyde?", "speaker": "Poole", "chunk_id": "jekyll_hyde-14"}
|
| 110 |
+
{"id": "dlg-109", "text": "O, dear no, sir. He never _dines_ here,", "speaker": "Poole", "chunk_id": "jekyll_hyde-14"}
|
| 111 |
+
{"id": "dlg-110", "text": "Indeed\nwe see very little of him on this side of the house; he mostly comes\nand goes by the laboratory.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 112 |
+
{"id": "dlg-111", "text": "Well, good-night, Poole.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 113 |
+
{"id": "dlg-112", "text": "Good-night, Mr. Utterson.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 114 |
+
{"id": "dlg-113", "text": "Poor Harry\nJekyll,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-14"}
|
| 115 |
+
{"id": "dlg-114", "text": "Poor Harry\nJekyll,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-15"}
|
| 116 |
+
{"id": "dlg-115", "text": "my mind misgives me he is in deep waters! He was\nwild when he was young; a long while ago to be sure; but in the law of\nGod, there is no statute of limitations. Ay, it must be that; the ghost\nof some old sin, the cancer of some concealed disgrace: punishment\ncoming, _pede claudo_, years after memory has forgotten and self-love\ncondoned the fault.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-15"}
|
| 117 |
+
{"id": "dlg-116", "text": "This Master Hyde, if he were studied,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-15"}
|
| 118 |
+
{"id": "dlg-117", "text": "if Jekyll will only\nlet me.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-15"}
|
| 119 |
+
{"id": "dlg-118", "text": "I have been wanting to speak to you, Jekyll,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-16"}
|
| 120 |
+
{"id": "dlg-119", "text": "You\nknow that will of yours?", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-16"}
|
| 121 |
+
{"id": "dlg-120", "text": "My poor Utterson,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-16"}
|
| 122 |
+
{"id": "dlg-121", "text": "You know I never approved of it,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-16"}
|
| 123 |
+
{"id": "dlg-122", "text": "My will? Yes, certainly, I know that,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-16"}
|
| 124 |
+
{"id": "dlg-123", "text": "You have told me so.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-16"}
|
| 125 |
+
{"id": "dlg-124", "text": "Well, I tell you so again,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-16"}
|
| 126 |
+
{"id": "dlg-125", "text": "I have been\nlearning something of young Hyde.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-16"}
|
| 127 |
+
{"id": "dlg-126", "text": "You have told me so.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-17"}
|
| 128 |
+
{"id": "dlg-127", "text": "Well, I tell you so again,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-17"}
|
| 129 |
+
{"id": "dlg-128", "text": "I have been\nlearning something of young Hyde.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-17"}
|
| 130 |
+
{"id": "dlg-129", "text": "I do not care to hear more,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-17"}
|
| 131 |
+
{"id": "dlg-130", "text": "This is a matter I thought we had agreed to drop.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-17"}
|
| 132 |
+
{"id": "dlg-131", "text": "What I heard was abominable,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-17"}
|
| 133 |
+
{"id": "dlg-132", "text": "It can make no change. You do not understand my position,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-17"}
|
| 134 |
+
{"id": "dlg-133", "text": "I am painfully\nsituated, Utterson; my position is a very strange—a very strange one.\nIt is one of those affairs that cannot be mended by talking.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-17"}
|
| 135 |
+
{"id": "dlg-134", "text": "Jekyll,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-17"}
|
| 136 |
+
{"id": "dlg-135", "text": "you know me: I am a man to be trusted. Make a\nclean breast of this in confidence; and I make no doubt I can get you\nout of it.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-17"}
|
| 137 |
+
{"id": "dlg-136", "text": "My good Utterson,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-17"}
|
| 138 |
+
{"id": "dlg-137", "text": "I have no doubt you are perfectly right,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-17"}
|
| 139 |
+
{"id": "dlg-138", "text": "Well, but since we have touched upon this business, and for the last\ntime I hope,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-17"}
|
| 140 |
+
{"id": "dlg-139", "text": "I can’t pretend that I shall ever like him,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-18"}
|
| 141 |
+
{"id": "dlg-140", "text": "I don’t ask that,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-18"}
|
| 142 |
+
{"id": "dlg-141", "text": "I only ask for justice; I only ask you to help him for my sake,\nwhen I am no longer here.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-18"}
|
| 143 |
+
{"id": "dlg-142", "text": "Well,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-18"}
|
| 144 |
+
{"id": "dlg-143", "text": "I promise.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-18"}
|
| 145 |
+
{"id": "dlg-144", "text": "I shall say nothing till I have seen the\nbody,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-20"}
|
| 146 |
+
{"id": "dlg-145", "text": "this may be very serious. Have the kindness to wait\nwhile I dress.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-20"}
|
| 147 |
+
{"id": "dlg-146", "text": "Yes,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-20"}
|
| 148 |
+
{"id": "dlg-147", "text": "I recognise him. I am sorry to say that this is Sir\nDanvers Carew.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-20"}
|
| 149 |
+
{"id": "dlg-148", "text": "Good God, sir,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-20"}
|
| 150 |
+
{"id": "dlg-149", "text": "Yes,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-21"}
|
| 151 |
+
{"id": "dlg-150", "text": "I recognise him. I am sorry to say that this is Sir\nDanvers Carew.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-21"}
|
| 152 |
+
{"id": "dlg-151", "text": "Good God, sir,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-21"}
|
| 153 |
+
{"id": "dlg-152", "text": "is it possible?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-21"}
|
| 154 |
+
{"id": "dlg-153", "text": "This will make a\ndeal of noise,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-21"}
|
| 155 |
+
{"id": "dlg-154", "text": "And perhaps you can help us to the man.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-21"}
|
| 156 |
+
{"id": "dlg-155", "text": "Is this Mr. Hyde a person of small stature?", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-21"}
|
| 157 |
+
{"id": "dlg-156", "text": "Particularly small and particularly wicked-looking, is what the maid\ncalls him,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-21"}
|
| 158 |
+
{"id": "dlg-157", "text": "If you will come\nwith me in my cab,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-21"}
|
| 159 |
+
{"id": "dlg-158", "text": "I think I can take you to his house.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-21"}
|
| 160 |
+
{"id": "dlg-159", "text": "Very well, then, we wish to see his rooms,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-22"}
|
| 161 |
+
{"id": "dlg-160", "text": "I had better tell you\nwho this person is,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-22"}
|
| 162 |
+
{"id": "dlg-161", "text": "This is Inspector Newcomen of Scotland\nYard.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-22"}
|
| 163 |
+
{"id": "dlg-162", "text": "Ah!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-22"}
|
| 164 |
+
{"id": "dlg-163", "text": "he is in trouble! What has he done?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-22"}
|
| 165 |
+
{"id": "dlg-164", "text": "He don’t seem a very\npopular character,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-22"}
|
| 166 |
+
{"id": "dlg-165", "text": "And now, my good woman, just\nlet me and this gentleman have a look about us.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-22"}
|
| 167 |
+
{"id": "dlg-166", "text": "And now, my good woman, just\nlet me and this gentleman have a look about us.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-23"}
|
| 168 |
+
{"id": "dlg-167", "text": "You may depend upon it, sir,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-23"}
|
| 169 |
+
{"id": "dlg-168", "text": "I have him in my\nhand. He must have lost his head, or he never would have left the stick\nor, above all, burned the cheque book. Why, money’s life to the man. We\nhave nothing to do but wait for him at the bank, and get out the\nhandbills.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-23"}
|
| 170 |
+
{"id": "dlg-169", "text": "And now,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-24"}
|
| 171 |
+
{"id": "dlg-170", "text": "you have\nheard the news?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-24"}
|
| 172 |
+
{"id": "dlg-171", "text": "They were crying it in the square,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-24"}
|
| 173 |
+
{"id": "dlg-172", "text": "I\nheard them in my dining-room.", "speaker": "Poole", "chunk_id": "jekyll_hyde-24"}
|
| 174 |
+
{"id": "dlg-173", "text": "One word,", "speaker": "Poole", "chunk_id": "jekyll_hyde-24"}
|
| 175 |
+
{"id": "dlg-174", "text": "Carew was my client, but so are you, and\nI want to know what I am doing. You have not been mad enough to hide\nthis fellow?", "speaker": "Poole", "chunk_id": "jekyll_hyde-24"}
|
| 176 |
+
{"id": "dlg-175", "text": "I\nheard them in my dining-room.", "speaker": "Poole", "chunk_id": "jekyll_hyde-25"}
|
| 177 |
+
{"id": "dlg-176", "text": "One word,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-25"}
|
| 178 |
+
{"id": "dlg-177", "text": "Carew was my client, but so are you, and\nI want to know what I am doing. You have not been mad enough to hide\nthis fellow?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-25"}
|
| 179 |
+
{"id": "dlg-178", "text": "Utterson, I swear to God,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-25"}
|
| 180 |
+
{"id": "dlg-179", "text": "I swear to God I will\nnever set eyes on him again. I bind my honour to you that I am done\nwith him in this world. It is all at an end. And indeed he does not\nwant my help; you do not know him as I do; he is safe, he is quite\nsafe; mark my words, he will never more be heard of.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-25"}
|
| 181 |
+
{"id": "dlg-180", "text": "You seem pretty sure of him,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-25"}
|
| 182 |
+
{"id": "dlg-181", "text": "and for your sake, I\nhope you may be right. If it came to a trial, your name might appear.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-25"}
|
| 183 |
+
{"id": "dlg-182", "text": "I am quite sure of him,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-25"}
|
| 184 |
+
{"id": "dlg-183", "text": "I have grounds for certainty\nthat I cannot share with any one. But there is one thing on which you\nmay advise me. I have—I have received a letter; and I am at a loss\nwhether I should show it to the police. I should like to leave it in\nyour hands, Utterson; you would judge wisely, I am sure; I have so\ngreat a trust in you.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-25"}
|
| 185 |
+
{"id": "dlg-184", "text": "You fear, I suppose, that it might lead to his detection?", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-25"}
|
| 186 |
+
{"id": "dlg-185", "text": "No,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-25"}
|
| 187 |
+
{"id": "dlg-186", "text": "I cannot say that I care what becomes of Hyde; I\nam quite done with him. I was thinking of my own character, which this\nhateful business has rather exposed.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-25"}
|
| 188 |
+
{"id": "dlg-187", "text": "Well,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-25"}
|
| 189 |
+
{"id": "dlg-188", "text": "let me\nsee the letter.", "speaker": "Hyde", "chunk_id": "jekyll_hyde-25"}
|
| 190 |
+
{"id": "dlg-189", "text": "Edward\nHyde", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-25"}
|
| 191 |
+
{"id": "dlg-190", "text": "Have you the envelope?", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-26"}
|
| 192 |
+
{"id": "dlg-191", "text": "I burned it,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-26"}
|
| 193 |
+
{"id": "dlg-192", "text": "before I thought what I was about. But\nit bore no postmark. The note was handed in.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-26"}
|
| 194 |
+
{"id": "dlg-193", "text": "Shall I keep this and sleep upon it?", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-26"}
|
| 195 |
+
{"id": "dlg-194", "text": "I wish you to judge for me entirely,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-26"}
|
| 196 |
+
{"id": "dlg-195", "text": "I have lost\nconfidence in myself.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-26"}
|
| 197 |
+
{"id": "dlg-196", "text": "Well, I shall consider,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-26"}
|
| 198 |
+
{"id": "dlg-197", "text": "And now one word more:\nit was Hyde who dictated the terms in your will about that\ndisappearance?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-26"}
|
| 199 |
+
{"id": "dlg-198", "text": "I knew it,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-26"}
|
| 200 |
+
{"id": "dlg-199", "text": "He meant to murder you. You had a fine\nescape.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-26"}
|
| 201 |
+
{"id": "dlg-200", "text": "I have had what is far more to the purpose,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-26"}
|
| 202 |
+
{"id": "dlg-201", "text": "I have had a lesson—O God, Utterson, what a lesson I have\nhad!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-26"}
|
| 203 |
+
{"id": "dlg-202", "text": "By the bye,", "speaker": "Poole", "chunk_id": "jekyll_hyde-26"}
|
| 204 |
+
{"id": "dlg-203", "text": "there was a letter handed in to-day: what was\nthe messenger like?", "speaker": "Poole", "chunk_id": "jekyll_hyde-26"}
|
| 205 |
+
{"id": "dlg-204", "text": "and only circulars by that,", "speaker": "Poole", "chunk_id": "jekyll_hyde-26"}
|
| 206 |
+
{"id": "dlg-205", "text": "Special edition.\nShocking murder of an M.P.", "speaker": "Poole", "chunk_id": "jekyll_hyde-26"}
|
| 207 |
+
{"id": "dlg-206", "text": "This is a sad business about Sir Danvers,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-27"}
|
| 208 |
+
{"id": "dlg-207", "text": "Yes, sir, indeed. It has elicited a great deal of public feeling,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-27"}
|
| 209 |
+
{"id": "dlg-208", "text": "The man, of course, was mad.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-27"}
|
| 210 |
+
{"id": "dlg-209", "text": "I should like to hear your views on that,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-27"}
|
| 211 |
+
{"id": "dlg-210", "text": "Yes, sir, indeed. It has elicited a great deal of public feeling,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 212 |
+
{"id": "dlg-211", "text": "The man, of course, was mad.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 213 |
+
{"id": "dlg-212", "text": "I should like to hear your views on that,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 214 |
+
{"id": "dlg-213", "text": "I have a\ndocument here in his handwriting; it is between ourselves, for I scarce\nknow what to do about it; it is an ugly business at the best. But there\nit is; quite in your way: a murderer’s autograph.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 215 |
+
{"id": "dlg-214", "text": "No sir,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 216 |
+
{"id": "dlg-215", "text": "not mad; but it is an odd hand.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 217 |
+
{"id": "dlg-216", "text": "And by all accounts a very odd writer,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-28"}
|
| 218 |
+
{"id": "dlg-217", "text": "Is that from Dr. Jekyll, sir?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 219 |
+
{"id": "dlg-218", "text": "I thought I knew\nthe writing. Anything private, Mr. Utterson?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 220 |
+
{"id": "dlg-219", "text": "Only an invitation to dinner. Why? Do you want to see it?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 221 |
+
{"id": "dlg-220", "text": "One moment. I thank you, sir;", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 222 |
+
{"id": "dlg-221", "text": "Thank you,\nsir,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 223 |
+
{"id": "dlg-222", "text": "it’s a very interesting\nautograph.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 224 |
+
{"id": "dlg-223", "text": "Why did you compare them, Guest?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 225 |
+
{"id": "dlg-224", "text": "Well, sir,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 226 |
+
{"id": "dlg-225", "text": "there’s a rather singular\nresemblance; the two hands are in many points identical: only\ndifferently sloped.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 227 |
+
{"id": "dlg-226", "text": "Rather quaint,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 228 |
+
{"id": "dlg-227", "text": "It is, as you say, rather quaint,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 229 |
+
{"id": "dlg-228", "text": "I wouldn’t speak of this note, you know,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 230 |
+
{"id": "dlg-229", "text": "No, sir,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 231 |
+
{"id": "dlg-230", "text": "I understand.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 232 |
+
{"id": "dlg-231", "text": "What!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 233 |
+
{"id": "dlg-232", "text": "Henry Jekyll forge for a murderer!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-28"}
|
| 234 |
+
{"id": "dlg-233", "text": "The doctor was confined to the house,", "speaker": "Poole", "chunk_id": "jekyll_hyde-29"}
|
| 235 |
+
{"id": "dlg-234", "text": "and\nsaw no one.", "speaker": "Poole", "chunk_id": "jekyll_hyde-29"}
|
| 236 |
+
{"id": "dlg-235", "text": "Yes,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 237 |
+
{"id": "dlg-236", "text": "he\nis a doctor, he must know his own state and that his days are counted;\nand the knowledge is more than he can bear.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 238 |
+
{"id": "dlg-237", "text": "I have had a shock,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 239 |
+
{"id": "dlg-238", "text": "and I shall never recover. It is a\nquestion of weeks. Well, life has been pleasant; I liked it; yes, sir,\nI used to like it. I sometimes think if we knew all, we should be more\nglad to get away.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 240 |
+
{"id": "dlg-239", "text": "Jekyll is ill, too,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 241 |
+
{"id": "dlg-240", "text": "Have you seen him?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 242 |
+
{"id": "dlg-241", "text": "I wish to\nsee or hear no more of Dr. Jekyll,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 243 |
+
{"id": "dlg-242", "text": "I am quite done with that person; and I beg that you will spare me any\nallusion to one whom I regard as dead.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 244 |
+
{"id": "dlg-243", "text": "Tut, tut!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 245 |
+
{"id": "dlg-244", "text": "Can’t I do anything?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 246 |
+
{"id": "dlg-245", "text": "We are three very old friends,\nLanyon; we shall not live to make others.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 247 |
+
{"id": "dlg-246", "text": "Nothing can be done,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 248 |
+
{"id": "dlg-247", "text": "ask himself.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 249 |
+
{"id": "dlg-248", "text": "He will not see me,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 250 |
+
{"id": "dlg-249", "text": "I am not surprised at that,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-30"}
|
| 251 |
+
{"id": "dlg-250", "text": "Nothing can be done,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-31"}
|
| 252 |
+
{"id": "dlg-251", "text": "ask himself.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-31"}
|
| 253 |
+
{"id": "dlg-252", "text": "He will not see me,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-31"}
|
| 254 |
+
{"id": "dlg-253", "text": "I am not surprised at that,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-31"}
|
| 255 |
+
{"id": "dlg-254", "text": "Some day, Utterson, after\nI am dead, you may perhaps come to learn the right and wrong of this. I\ncannot tell you. And in the meantime, if you can sit and talk with me\nof other things, for God’s sake, stay and do so; but if you cannot keep\nclear of this accursed topic, then in God’s name, go, for I cannot bear\nit.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-31"}
|
| 256 |
+
{"id": "dlg-255", "text": "I do not blame our\nold friend,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-31"}
|
| 257 |
+
{"id": "dlg-256", "text": "PRIVATE: for the hands of G. J. Utterson ALONE,\nand in case of his predecease _to be destroyed unread_,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-32"}
|
| 258 |
+
{"id": "dlg-257", "text": "I have buried one friend to-day,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-32"}
|
| 259 |
+
{"id": "dlg-258", "text": "what if this\nshould cost me another?", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-32"}
|
| 260 |
+
{"id": "dlg-259", "text": "not to be opened till\nthe death or disappearance of Dr. Henry Jekyll.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-32"}
|
| 261 |
+
{"id": "dlg-260", "text": "Well,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 262 |
+
{"id": "dlg-261", "text": "that story’s at an end at least. We shall never\nsee more of Mr. Hyde.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 263 |
+
{"id": "dlg-262", "text": "I hope not,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 264 |
+
{"id": "dlg-263", "text": "Did I ever tell you that I once saw him,\nand shared your feeling of repulsion?", "speaker": null, "chunk_id": "jekyll_hyde-34"}
|
| 265 |
+
{"id": "dlg-264", "text": "It was impossible to do the one without the other,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 266 |
+
{"id": "dlg-265", "text": "And by the way, what an ass you must have thought me, not to know that\nthis was a back way to Dr. Jekyll’s! It was partly your own fault that\nI found it out, even when I did.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 267 |
+
{"id": "dlg-266", "text": "So you found it out, did you?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 268 |
+
{"id": "dlg-267", "text": "But if that be so, we\nmay step into the court and take a look at the windows. To tell you the\ntruth, I am uneasy about poor Jekyll; and even outside, I feel as if\nthe presence of a friend might do him good.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 269 |
+
{"id": "dlg-268", "text": "What! Jekyll!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 270 |
+
{"id": "dlg-269", "text": "I trust you are better.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 271 |
+
{"id": "dlg-270", "text": "I am very low, Utterson,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 272 |
+
{"id": "dlg-271", "text": "very low. It\nwill not last long, thank God.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 273 |
+
{"id": "dlg-272", "text": "You stay too much indoors,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 274 |
+
{"id": "dlg-273", "text": "You should be out,\nwhipping up the circulation like Mr. Enfield and me. (This is my\ncousin—Mr. Enfield—Dr. Jekyll.) Come now; get your hat and take a quick\nturn with us.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 275 |
+
{"id": "dlg-274", "text": "You are very good,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 276 |
+
{"id": "dlg-275", "text": "I should like to very much; but\nno, no, no, it is quite impossible; I dare not. But indeed, Utterson, I\nam very glad to see you; this is really a great pleasure; I would ask\nyou and Mr. Enfield up, but the place is really not fit.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-34"}
|
| 277 |
+
{"id": "dlg-276", "text": "Why, then,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-34"}
|
| 278 |
+
{"id": "dlg-277", "text": "Why, then,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-35"}
|
| 279 |
+
{"id": "dlg-278", "text": "the best thing we can do\nis to stay down here and speak with you from where we are.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-35"}
|
| 280 |
+
{"id": "dlg-279", "text": "That is just what I was about to venture to propose,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-35"}
|
| 281 |
+
{"id": "dlg-280", "text": "God forgive us, God forgive us,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-35"}
|
| 282 |
+
{"id": "dlg-281", "text": "Bless me, Poole, what brings you here?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-36"}
|
| 283 |
+
{"id": "dlg-282", "text": "What ails you?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-36"}
|
| 284 |
+
{"id": "dlg-283", "text": "is the doctor ill?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-36"}
|
| 285 |
+
{"id": "dlg-284", "text": "Mr. Utterson,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-36"}
|
| 286 |
+
{"id": "dlg-285", "text": "there is something wrong.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-36"}
|
| 287 |
+
{"id": "dlg-286", "text": "Take a seat, and here is a glass of wine for you,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-36"}
|
| 288 |
+
{"id": "dlg-287", "text": "Now, take your time, and tell me plainly what you want.", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 289 |
+
{"id": "dlg-288", "text": "You know the doctor’s ways, sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 290 |
+
{"id": "dlg-289", "text": "and how he shuts\nhimself up. Well, he’s shut up again in the cabinet; and I don’t like\nit, sir—I wish I may die if I like it. Mr. Utterson, sir, I’m afraid.", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 291 |
+
{"id": "dlg-290", "text": "Now, my good man,", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 292 |
+
{"id": "dlg-291", "text": "be explicit. What are you afraid\nof?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-36"}
|
| 293 |
+
{"id": "dlg-292", "text": "I’ve been afraid for about a week,", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 294 |
+
{"id": "dlg-293", "text": "and I can bear it no more.", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 295 |
+
{"id": "dlg-294", "text": "I can bear it no more,", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 296 |
+
{"id": "dlg-295", "text": "Come,", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 297 |
+
{"id": "dlg-296", "text": "I see you have some good reason, Poole; I see\nthere is something seriously amiss. Try to tell me what it is.", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 298 |
+
{"id": "dlg-297", "text": "I think there’s been foul play,", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 299 |
+
{"id": "dlg-298", "text": "Foul play!", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 300 |
+
{"id": "dlg-299", "text": "What foul play! What does the\nman mean?", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 301 |
+
{"id": "dlg-300", "text": "I daren’t say, sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-36"}
|
| 302 |
+
{"id": "dlg-301", "text": "but will you come along with me\nand see for yourself?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-36"}
|
| 303 |
+
{"id": "dlg-302", "text": "Well, sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-37"}
|
| 304 |
+
{"id": "dlg-303", "text": "here we are, and God grant there be nothing\nwrong.", "speaker": "Poole", "chunk_id": "jekyll_hyde-37"}
|
| 305 |
+
{"id": "dlg-304", "text": "Amen, Poole,", "speaker": "Poole", "chunk_id": "jekyll_hyde-37"}
|
| 306 |
+
{"id": "dlg-305", "text": "Is that you,\nPoole?", "speaker": "Poole", "chunk_id": "jekyll_hyde-37"}
|
| 307 |
+
{"id": "dlg-306", "text": "It’s all right,", "speaker": "Poole", "chunk_id": "jekyll_hyde-37"}
|
| 308 |
+
{"id": "dlg-307", "text": "Open the door.", "speaker": "Poole", "chunk_id": "jekyll_hyde-37"}
|
| 309 |
+
{"id": "dlg-308", "text": "Bless God! it’s Mr. Utterson,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-37"}
|
| 310 |
+
{"id": "dlg-309", "text": "What, what? Are you all here?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-37"}
|
| 311 |
+
{"id": "dlg-310", "text": "Bless God! it’s Mr. Utterson,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-38"}
|
| 312 |
+
{"id": "dlg-311", "text": "What, what? Are you all here?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-38"}
|
| 313 |
+
{"id": "dlg-312", "text": "Very\nirregular, very unseemly; your master would be far from pleased.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-38"}
|
| 314 |
+
{"id": "dlg-313", "text": "They’re all afraid,", "speaker": "Poole", "chunk_id": "jekyll_hyde-38"}
|
| 315 |
+
{"id": "dlg-314", "text": "Hold your tongue!", "speaker": "Poole", "chunk_id": "jekyll_hyde-38"}
|
| 316 |
+
{"id": "dlg-315", "text": "And\nnow,", "speaker": "Poole", "chunk_id": "jekyll_hyde-38"}
|
| 317 |
+
{"id": "dlg-316", "text": "reach me a\ncandle, and we’ll get this through hands at once.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-38"}
|
| 318 |
+
{"id": "dlg-317", "text": "Now, sir,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-38"}
|
| 319 |
+
{"id": "dlg-318", "text": "you come as gently as you can. I want you to\nhear, and I don’t want you to be heard. And see here, sir, if by any\nchance he was to ask you in, don’t go.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-38"}
|
| 320 |
+
{"id": "dlg-319", "text": "Mr. Utterson, sir, asking to see you,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-38"}
|
| 321 |
+
{"id": "dlg-320", "text": "Tell him I cannot see anyone,", "speaker": "Poole", "chunk_id": "jekyll_hyde-38"}
|
| 322 |
+
{"id": "dlg-321", "text": "Thank you, sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-38"}
|
| 323 |
+
{"id": "dlg-322", "text": "Thank you, sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-39"}
|
| 324 |
+
{"id": "dlg-323", "text": "Sir,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-39"}
|
| 325 |
+
{"id": "dlg-324", "text": "Was that my master’s\nvoice?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-39"}
|
| 326 |
+
{"id": "dlg-325", "text": "It seems much changed,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-39"}
|
| 327 |
+
{"id": "dlg-326", "text": "Changed? Well, yes, I think so,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-39"}
|
| 328 |
+
{"id": "dlg-327", "text": "Have I been twenty\nyears in this man’s house, to be deceived about his voice? No, sir;\nmaster’s made away with; he was made away with eight days ago, when we\nheard him cry out upon the name of God; and _who’s_ in there instead of\nhim, and _why_ it stays there, is a thing that cries to Heaven, Mr.\nUtterson!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-39"}
|
| 329 |
+
{"id": "dlg-328", "text": "This is a very strange tale, Poole; this is rather a wild tale my\nman,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-39"}
|
| 330 |
+
{"id": "dlg-329", "text": "Suppose it were as you\nsuppose, supposing Dr. Jekyll to have been—well, murdered, what could\ninduce the murderer to stay? That won’t hold water; it doesn’t commend\nitself to reason.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-39"}
|
| 331 |
+
{"id": "dlg-330", "text": "Well, Mr. Utterson, you are a hard man to satisfy, but I’ll do it\nyet,", "speaker": "Poole", "chunk_id": "jekyll_hyde-39"}
|
| 332 |
+
{"id": "dlg-331", "text": "Have you any of these papers?", "speaker": "Poole", "chunk_id": "jekyll_hyde-40"}
|
| 333 |
+
{"id": "dlg-332", "text": "For God’s sake,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-40"}
|
| 334 |
+
{"id": "dlg-333", "text": "find me some of the old.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-40"}
|
| 335 |
+
{"id": "dlg-334", "text": "This is a strange note,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-40"}
|
| 336 |
+
{"id": "dlg-335", "text": "How do\nyou come to have it open?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-40"}
|
| 337 |
+
{"id": "dlg-336", "text": "The man at Maw’s was main angry, sir, and he threw it back to me like\nso much dirt,", "speaker": "Poole", "chunk_id": "jekyll_hyde-40"}
|
| 338 |
+
{"id": "dlg-337", "text": "This is unquestionably the doctor’s hand, do you know?", "speaker": "Poole", "chunk_id": "jekyll_hyde-40"}
|
| 339 |
+
{"id": "dlg-338", "text": "I thought it looked like it,", "speaker": "Poole", "chunk_id": "jekyll_hyde-40"}
|
| 340 |
+
{"id": "dlg-339", "text": "But what matters hand of write?", "speaker": "Poole", "chunk_id": "jekyll_hyde-40"}
|
| 341 |
+
{"id": "dlg-340", "text": "I’ve seen him!", "speaker": "Poole", "chunk_id": "jekyll_hyde-40"}
|
| 342 |
+
{"id": "dlg-341", "text": "Seen him?", "speaker": "Poole", "chunk_id": "jekyll_hyde-40"}
|
| 343 |
+
{"id": "dlg-342", "text": "Well?", "speaker": "Poole", "chunk_id": "jekyll_hyde-40"}
|
| 344 |
+
{"id": "dlg-343", "text": "That’s it!", "speaker": "Poole", "chunk_id": "jekyll_hyde-40"}
|
| 345 |
+
{"id": "dlg-344", "text": "These are all very strange circumstances,", "speaker": "Poole", "chunk_id": "jekyll_hyde-41"}
|
| 346 |
+
{"id": "dlg-345", "text": "Sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-41"}
|
| 347 |
+
{"id": "dlg-346", "text": "that\nthing was not my master, and there’s the truth. My master", "speaker": "Utterson", "chunk_id": "jekyll_hyde-41"}
|
| 348 |
+
{"id": "dlg-347", "text": "is a tall, fine build of a man,\nand this was more of a dwarf.", "speaker": "Poole", "chunk_id": "jekyll_hyde-41"}
|
| 349 |
+
{"id": "dlg-348", "text": "O, sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-41"}
|
| 350 |
+
{"id": "dlg-349", "text": "do you think I do not know my master after twenty years?\nDo you think I do not know where his head comes to in the cabinet door,\nwhere I saw him every morning of my life? No, sir, that thing in the\nmask was never Dr. Jekyll—God knows what it was, but it was never Dr.\nJekyll; and it is the belief of my heart that there was murder done.", "speaker": "Poole", "chunk_id": "jekyll_hyde-41"}
|
| 351 |
+
{"id": "dlg-350", "text": "Poole,", "speaker": "Poole", "chunk_id": "jekyll_hyde-41"}
|
| 352 |
+
{"id": "dlg-351", "text": "if you say that, it will become my duty\nto make certain. Much as I desire to spare your master’s feelings, much\nas I am puzzled by this note which seems to prove him to be still\nalive, I shall consider it my duty to break in that door.", "speaker": "Poole", "chunk_id": "jekyll_hyde-41"}
|
| 353 |
+
{"id": "dlg-352", "text": "Ah, Mr. Utterson, that’s talking!", "speaker": "Poole", "chunk_id": "jekyll_hyde-41"}
|
| 354 |
+
{"id": "dlg-353", "text": "And now comes the second question,", "speaker": "Poole", "chunk_id": "jekyll_hyde-41"}
|
| 355 |
+
{"id": "dlg-354", "text": "Ah, Mr. Utterson, that’s talking!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-42"}
|
| 356 |
+
{"id": "dlg-355", "text": "And now comes the second question,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-42"}
|
| 357 |
+
{"id": "dlg-356", "text": "Who is going to\ndo it?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-42"}
|
| 358 |
+
{"id": "dlg-357", "text": "Why, you and me, sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 359 |
+
{"id": "dlg-358", "text": "That’s very well said,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-42"}
|
| 360 |
+
{"id": "dlg-359", "text": "and whatever comes of\nit, I shall make it my business to see you are no loser.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-42"}
|
| 361 |
+
{"id": "dlg-360", "text": "There is an axe in the theatre,", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 362 |
+
{"id": "dlg-361", "text": "and you might take\nthe kitchen poker for yourself.", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 363 |
+
{"id": "dlg-362", "text": "Do you know, Poole,", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 364 |
+
{"id": "dlg-363", "text": "that you and I\nare about to place ourselves in a position of some peril?", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 365 |
+
{"id": "dlg-364", "text": "You may say so, sir, indeed,", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 366 |
+
{"id": "dlg-365", "text": "It is well, then that we should be frank,", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 367 |
+
{"id": "dlg-366", "text": "We both\nthink more than we have said; let us make a clean breast. This masked\nfigure that you saw, did you recognise it?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-42"}
|
| 368 |
+
{"id": "dlg-367", "text": "Well, sir, it went so quick, and the creature was so doubled up, that\nI could hardly swear to that,", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 369 |
+
{"id": "dlg-368", "text": "But if you mean, was it\nMr. Hyde?—why, yes, I think it was! You see, it was much of the same\nbigness; and it had the same quick, light way with it; and then who\nelse could have got in by the laboratory door? You have not forgot,\nsir, that at the time of the murder he had still the key with him? But\nthat’s not all. I don’t know, Mr. Utterson, if you ever met this Mr.\nHyde?", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 370 |
+
{"id": "dlg-369", "text": "Yes,", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 371 |
+
{"id": "dlg-370", "text": "I once spoke with him.", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 372 |
+
{"id": "dlg-371", "text": "Then you must know as well as the rest of us that there was something\nqueer about that gentleman—something that gave a man a turn—I don’t\nknow rightly how to say it, sir, beyond this: that you felt in your\nmarrow kind of cold and thin.", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 373 |
+
{"id": "dlg-372", "text": "I own I felt something of what you describe,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-42"}
|
| 374 |
+
{"id": "dlg-373", "text": "Quite so, sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-42"}
|
| 375 |
+
{"id": "dlg-374", "text": "Quite so, sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-43"}
|
| 376 |
+
{"id": "dlg-375", "text": "Well, when that masked thing like a\nmonkey jumped from among the chemicals and whipped into the cabinet, it\nwent down my spine like ice. O, I know it’s not evidence, Mr. Utterson;\nI’m book-learned enough for that; but a man has his feelings, and I\ngive you my bible-word it was Mr. Hyde!", "speaker": "Poole", "chunk_id": "jekyll_hyde-43"}
|
| 377 |
+
{"id": "dlg-376", "text": "Ay, ay,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-43"}
|
| 378 |
+
{"id": "dlg-377", "text": "My fears incline to the same point. Evil, I\nfear, founded—evil was sure to come—of that connection. Ay truly, I\nbelieve you; I believe poor Harry is killed; and I believe his murderer\n(for what purpose, God alone can tell) is still lurking in his victim’s\nroom. Well, let our name be vengeance. Call Bradshaw.", "speaker": "Hyde", "chunk_id": "jekyll_hyde-43"}
|
| 379 |
+
{"id": "dlg-378", "text": "Pull yourself together, Bradshaw,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-43"}
|
| 380 |
+
{"id": "dlg-379", "text": "And now, Poole, let\nus get to ours,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-43"}
|
| 381 |
+
{"id": "dlg-380", "text": "So it will walk all day, sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-43"}
|
| 382 |
+
{"id": "dlg-381", "text": "So it will walk all day, sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-44"}
|
| 383 |
+
{"id": "dlg-382", "text": "ay, and the better\npart of the night. Only when a new sample comes from the chemist,\nthere’s a bit of a break. Ah, it’s an ill conscience that’s such an\nenemy to rest! Ah, sir, there’s blood foully shed in every step of it!\nBut hark again, a little closer—put your heart in your ears, Mr.\nUtterson, and tell me, is that the doctor’s foot?", "speaker": "Poole", "chunk_id": "jekyll_hyde-44"}
|
| 384 |
+
{"id": "dlg-383", "text": "Is there never anything else?", "speaker": "Poole", "chunk_id": "jekyll_hyde-44"}
|
| 385 |
+
{"id": "dlg-384", "text": "Once,", "speaker": "Poole", "chunk_id": "jekyll_hyde-44"}
|
| 386 |
+
{"id": "dlg-385", "text": "Once I heard it weeping!", "speaker": "Poole", "chunk_id": "jekyll_hyde-44"}
|
| 387 |
+
{"id": "dlg-386", "text": "Weeping? how that?", "speaker": "Poole", "chunk_id": "jekyll_hyde-44"}
|
| 388 |
+
{"id": "dlg-387", "text": "Weeping like a woman or a lost soul,", "speaker": "Poole", "chunk_id": "jekyll_hyde-44"}
|
| 389 |
+
{"id": "dlg-388", "text": "I came away\nwith that upon my heart, that I could have wept too.", "speaker": "Poole", "chunk_id": "jekyll_hyde-44"}
|
| 390 |
+
{"id": "dlg-389", "text": "Jekyll,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-44"}
|
| 391 |
+
{"id": "dlg-390", "text": "I demand to see you.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-44"}
|
| 392 |
+
{"id": "dlg-391", "text": "I give you fair warning, our\nsuspicions are aroused, and I must and shall see you,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-44"}
|
| 393 |
+
{"id": "dlg-392", "text": "if\nnot by fair means, then by foul—if not of your consent, then by brute\nforce!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-44"}
|
| 394 |
+
{"id": "dlg-393", "text": "Utterson,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-44"}
|
| 395 |
+
{"id": "dlg-394", "text": "for God’s sake, have mercy!", "speaker": "Hyde", "chunk_id": "jekyll_hyde-44"}
|
| 396 |
+
{"id": "dlg-395", "text": "Ah, that’s not Jekyll’s voice—it’s Hyde’s!", "speaker": "Hyde", "chunk_id": "jekyll_hyde-44"}
|
| 397 |
+
{"id": "dlg-396", "text": "Down with\nthe door, Poole!", "speaker": "Hyde", "chunk_id": "jekyll_hyde-44"}
|
| 398 |
+
{"id": "dlg-397", "text": "We have come too late,", "speaker": "Hyde", "chunk_id": "jekyll_hyde-45"}
|
| 399 |
+
{"id": "dlg-398", "text": "whether to save or punish.\nHyde is gone to his account; and it only remains for us to find the\nbody of your master.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-45"}
|
| 400 |
+
{"id": "dlg-399", "text": "He must be buried here,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-46"}
|
| 401 |
+
{"id": "dlg-400", "text": "Or he may have fled,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-46"}
|
| 402 |
+
{"id": "dlg-401", "text": "This does not look like use,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-46"}
|
| 403 |
+
{"id": "dlg-402", "text": "Use!", "speaker": "Utterson", "chunk_id": "jekyll_hyde-46"}
|
| 404 |
+
{"id": "dlg-403", "text": "Do you not see, sir, it is broken? much as if a\nman had stamped on it.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-46"}
|
| 405 |
+
{"id": "dlg-404", "text": "Ay,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-46"}
|
| 406 |
+
{"id": "dlg-405", "text": "and the fractures, too, are rusty.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-46"}
|
| 407 |
+
{"id": "dlg-406", "text": "This is beyond me, Poole,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-46"}
|
| 408 |
+
{"id": "dlg-407", "text": "Let us go back to the cabinet.", "speaker": "Poole", "chunk_id": "jekyll_hyde-46"}
|
| 409 |
+
{"id": "dlg-408", "text": "That is the same drug that I was always bringing him,", "speaker": "Poole", "chunk_id": "jekyll_hyde-46"}
|
| 410 |
+
{"id": "dlg-409", "text": "This glass has seen some strange things, sir,", "speaker": "Poole", "chunk_id": "jekyll_hyde-47"}
|
| 411 |
+
{"id": "dlg-410", "text": "And surely none stranger than itself,", "speaker": "Poole", "chunk_id": "jekyll_hyde-47"}
|
| 412 |
+
{"id": "dlg-411", "text": "For what did Jekyll", "speaker": "Poole", "chunk_id": "jekyll_hyde-47"}
|
| 413 |
+
{"id": "dlg-412", "text": "what could Jekyll want with\nit?", "speaker": "Poole", "chunk_id": "jekyll_hyde-47"}
|
| 414 |
+
{"id": "dlg-413", "text": "You may say that!", "speaker": "Poole", "chunk_id": "jekyll_hyde-47"}
|
| 415 |
+
{"id": "dlg-414", "text": "My head goes round,", "speaker": "Poole", "chunk_id": "jekyll_hyde-47"}
|
| 416 |
+
{"id": "dlg-415", "text": "My head goes round,", "speaker": "Poole", "chunk_id": "jekyll_hyde-48"}
|
| 417 |
+
{"id": "dlg-416", "text": "He has been all these days in\npossession; he had no cause to like me; he must have raged to see\nhimself displaced; and he has not destroyed this document.", "speaker": "Poole", "chunk_id": "jekyll_hyde-48"}
|
| 418 |
+
{"id": "dlg-417", "text": "O Poole!", "speaker": "Poole", "chunk_id": "jekyll_hyde-48"}
|
| 419 |
+
{"id": "dlg-418", "text": "he was alive and\nhere this day. He cannot have been disposed of in so short a space; he\nmust be still alive, he must have fled! And then, why fled? and how?\nand in that case, can we venture to declare this suicide? O, we must be\ncareful. I foresee that we may yet involve your master in some dire\ncatastrophe.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-48"}
|
| 420 |
+
{"id": "dlg-419", "text": "Why don’t you read it, sir?", "speaker": "Poole", "chunk_id": "jekyll_hyde-48"}
|
| 421 |
+
{"id": "dlg-420", "text": "Because I fear,", "speaker": "Poole", "chunk_id": "jekyll_hyde-48"}
|
| 422 |
+
{"id": "dlg-421", "text": "God grant I have no\ncause for it!", "speaker": "Poole", "chunk_id": "jekyll_hyde-48"}
|
| 423 |
+
{"id": "dlg-422", "text": "Your unworthy and unhappy friend,\n\n“HENRY JEKYLL.", "speaker": "Utterson", "chunk_id": "jekyll_hyde-48"}
|
| 424 |
+
{"id": "dlg-423", "text": "There was a third enclosure?", "speaker": "Utterson", "chunk_id": "jekyll_hyde-48"}
|
| 425 |
+
{"id": "dlg-424", "text": "Here, sir,", "speaker": "Utterson", "chunk_id": "jekyll_hyde-48"}
|
| 426 |
+
{"id": "dlg-425", "text": "I would say nothing of this paper. If\nyour master has fled or is dead, we may at least save his credit. It is\nnow ten; I must go home and read these documents in quiet; but I shall\nbe back before midnight, when we shall send for the police.", "speaker": "Poole", "chunk_id": "jekyll_hyde-48"}
|
| 427 |
+
{"id": "dlg-426", "text": "double", "speaker": null, "chunk_id": "jekyll_hyde-52"}
|
| 428 |
+
{"id": "dlg-427", "text": "total failure!!!", "speaker": "Poole", "chunk_id": "jekyll_hyde-52"}
|
| 429 |
+
{"id": "dlg-428", "text": "Are you come from Dr. Jekyll?", "speaker": "Poole", "chunk_id": "jekyll_hyde-52"}
|
| 430 |
+
{"id": "dlg-429", "text": "yes", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-52"}
|
| 431 |
+
{"id": "dlg-430", "text": "yes", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-53"}
|
| 432 |
+
{"id": "dlg-431", "text": "Have you got it?", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-54"}
|
| 433 |
+
{"id": "dlg-432", "text": "Have you got it?", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-54"}
|
| 434 |
+
{"id": "dlg-433", "text": "Come, sir,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-54"}
|
| 435 |
+
{"id": "dlg-434", "text": "You forget that I have not yet the\npleasure of your acquaintance. Be seated, if you please.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-54"}
|
| 436 |
+
{"id": "dlg-435", "text": "I beg your pardon, Dr. Lanyon,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-54"}
|
| 437 |
+
{"id": "dlg-436", "text": "What you\nsay is very well founded; and my impatience has shown its heels to my\npoliteness. I come here at the instance of your colleague, Dr. Henry\nJekyll, on a piece of business of some moment; and I understood...", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-54"}
|
| 438 |
+
{"id": "dlg-437", "text": "I understood, a drawer...", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-54"}
|
| 439 |
+
{"id": "dlg-438", "text": "There it is, sir,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-54"}
|
| 440 |
+
{"id": "dlg-439", "text": "Compose yourself,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-55"}
|
| 441 |
+
{"id": "dlg-440", "text": "Have\nyou a graduated glass?", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-55"}
|
| 442 |
+
{"id": "dlg-441", "text": "And now,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-55"}
|
| 443 |
+
{"id": "dlg-442", "text": "Sir,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-56"}
|
| 444 |
+
{"id": "dlg-443", "text": "you speak enigmas, and you will perhaps not wonder that I\nhear you with no very strong impression of belief. But I have gone too\nfar in the way of inexplicable services to pause before I see the end.", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-56"}
|
| 445 |
+
{"id": "dlg-444", "text": "It is well,", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-56"}
|
| 446 |
+
{"id": "dlg-445", "text": "Lanyon, you remember your vows: what\nfollows is under the seal of our profession. And now, you who have so\nlong been bound to the most narrow and material views, you who have\ndenied the virtue of transcendental medicine, you who have derided your\nsuperiors—behold!", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-56"}
|
| 447 |
+
{"id": "dlg-446", "text": "O God!", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-56"}
|
| 448 |
+
{"id": "dlg-447", "text": "O God!", "speaker": "Jekyll", "chunk_id": "jekyll_hyde-56"}
|
data/indexes/worldview.jsonl
ADDED
|
@@ -0,0 +1,510 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "wv-0", "text": "Mr. Utterson was a man of rugged countenance, cold and dreary yet lovable.", "type": "character", "entity": "Mr. Utterson", "source_chunk": "jekyll_hyde-0"}
|
| 2 |
+
{"id": "wv-1", "text": "Mr. Utterson was austere with himself, mortifying his taste for vintages by drinking gin alone.", "type": "character", "entity": "Mr. Utterson", "source_chunk": "jekyll_hyde-0"}
|
| 3 |
+
{"id": "wv-2", "text": "Mr. Utterson had an approved tolerance for others, inclined to help rather than reprove.", "type": "character", "entity": "Mr. Utterson", "source_chunk": "jekyll_hyde-0"}
|
| 4 |
+
{"id": "wv-3", "text": "Mr. Utterson inclined to Cain’s heresy, allowing others to go their own way.", "type": "belief", "entity": "Mr", "source_chunk": "jekyll_hyde-0"}
|
| 5 |
+
{"id": "wv-4", "text": "Mr. Utterson was united to Mr. Richard Enfield, a distant kinsman and well-known man about town.", "type": "relationship", "entity": "Mr. Richard Enfield", "source_chunk": "jekyll_hyde-0"}
|
| 6 |
+
{"id": "wv-5", "text": "Mr. Utterson maintained a demeanor unchanged in the presence of downgoing men in his chambers.", "type": "setting", "entity": "chambers", "source_chunk": "jekyll_hyde-0"}
|
| 7 |
+
{"id": "wv-6", "text": "Two men enjoyed Sunday walks, valuing them as the chief jewel of each week.", "type": "event", "entity": "Two", "source_chunk": "jekyll_hyde-1"}
|
| 8 |
+
{"id": "wv-7", "text": "Setting includes a busy quarter of London with a small, quiet street.", "type": "location", "entity": "London", "source_chunk": "jekyll_hyde-1"}
|
| 9 |
+
{"id": "wv-8", "text": "Street thrived on weekdays, inhabitants doing well and hoping for better.", "type": "setting", "entity": "Street", "source_chunk": "jekyll_hyde-1"}
|
| 10 |
+
{"id": "wv-9", "text": "Street appeared clean and inviting, contrasting with its dingy neighborhood.", "type": "setting", "entity": "Street", "source_chunk": "jekyll_hyde-1"}
|
| 11 |
+
{"id": "wv-10", "text": "Entry of a court broke the line of shop fronts on the street.", "type": "location", "entity": "court", "source_chunk": "jekyll_hyde-1"}
|
| 12 |
+
{"id": "wv-11", "text": "Building showed signs of negligence, with a door and no windows.", "type": "location", "entity": "sinister block of building", "source_chunk": "jekyll_hyde-1"}
|
| 13 |
+
{"id": "wv-12", "text": "Tramps slouched into the recess of the building, children kept shop on the steps.", "type": "event", "entity": "Tramps", "source_chunk": "jekyll_hyde-1"}
|
| 14 |
+
{"id": "wv-13", "text": "A part of town where there was literally nothing to be seen but lamps, all lighted up as if for a procession and all as empty as a church.", "type": "setting", "entity": null, "source_chunk": "jekyll_hyde-2"}
|
| 15 |
+
{"id": "wv-14", "text": "A man trampled calmly over a child's body and left her screaming on the ground.", "type": "event", "entity": null, "source_chunk": "jekyll_hyde-2"}
|
| 16 |
+
{"id": "wv-15", "text": "No one had appeared to drive away random visitors or to repair the ravages of the door.", "type": "rule", "entity": "No", "source_chunk": "jekyll_hyde-2"}
|
| 17 |
+
{"id": "wv-16", "text": "A by-street where Mr. Enfield and the lawyer were walking.", "type": "location", "entity": "Mr", "source_chunk": "jekyll_hyde-2"}
|
| 18 |
+
{"id": "wv-17", "text": "Presence of a group around the screaming child.", "type": "organization", "entity": "Presence", "source_chunk": "jekyll_hyde-2"}
|
| 19 |
+
{"id": "wv-18", "text": "A child screams, prompting a group to gather around.", "type": "event", "entity": null, "source_chunk": "jekyll_hyde-3"}
|
| 20 |
+
{"id": "wv-19", "text": "A doctor arrives after being summoned for the child.", "type": "organization", "entity": "doctor", "source_chunk": "jekyll_hyde-3"}
|
| 21 |
+
{"id": "wv-20", "text": "A scene unfolds in a public space with a crowd gathering.", "type": "setting", "entity": null, "source_chunk": "jekyll_hyde-3"}
|
| 22 |
+
{"id": "wv-21", "text": "Threat of scandal used to coerce a man into paying compensation.", "type": "rule", "entity": "Threat", "source_chunk": "jekyll_hyde-3"}
|
| 23 |
+
{"id": "wv-22", "text": "A man is confronted by the child's family and others for his actions.", "type": "event", "entity": null, "source_chunk": "jekyll_hyde-3"}
|
| 24 |
+
{"id": "wv-23", "text": "Threat made to ruin a man's reputation throughout London.", "type": "location", "entity": "London", "source_chunk": "jekyll_hyde-3"}
|
| 25 |
+
{"id": "wv-24", "text": "A negotiation occurs for compensation for the child's family.", "type": "event", "entity": null, "source_chunk": "jekyll_hyde-3"}
|
| 26 |
+
{"id": "wv-25", "text": "Negotiation for a hundred pounds for a child's family.", "type": "event", "entity": "Negotiation", "source_chunk": "jekyll_hyde-4"}
|
| 27 |
+
{"id": "wv-26", "text": "Place with the door where money was retrieved.", "type": "location", "entity": "Black Mail House", "source_chunk": "jekyll_hyde-4"}
|
| 28 |
+
{"id": "wv-27", "text": "Bank where cheque was drawn payable to bearer.", "type": "organization", "entity": "Coutts’s", "source_chunk": "jekyll_hyde-4"}
|
| 29 |
+
{"id": "wv-28", "text": "A man does not walk into a cellar door at four in the morning and come out with another man’s cheque.", "type": "rule", "entity": null, "source_chunk": "jekyll_hyde-4"}
|
| 30 |
+
{"id": "wv-29", "text": "Group went to the bank to cash the cheque.", "type": "event", "entity": "Group", "source_chunk": "jekyll_hyde-4"}
|
| 31 |
+
{"id": "wv-30", "text": "Cheque was confirmed as genuine despite suspicions.", "type": "event", "entity": "Cheque", "source_chunk": "jekyll_hyde-4"}
|
| 32 |
+
{"id": "wv-31", "text": "Night spent in chambers before going to the bank.", "type": "setting", "entity": "Night", "source_chunk": "jekyll_hyde-4"}
|
| 33 |
+
{"id": "wv-32", "text": "Blackmail is implied as a motive for the cheque.", "type": "rule", "entity": "Blackmail", "source_chunk": "jekyll_hyde-4"}
|
| 34 |
+
{"id": "wv-33", "text": "The more it looks like Queer Street, the less I ask.", "type": "rule", "entity": "The", "source_chunk": "jekyll_hyde-5"}
|
| 35 |
+
{"id": "wv-34", "text": "Place with the door referred to as Black Mail House.", "type": "location", "entity": "Black Mail House", "source_chunk": "jekyll_hyde-5"}
|
| 36 |
+
{"id": "wv-35", "text": "Buildings are packed together about the court, making it hard to distinguish one from another.", "type": "setting", "entity": "Buildings", "source_chunk": "jekyll_hyde-5"}
|
| 37 |
+
{"id": "wv-36", "text": "Mr. Enfield recalls a past adventure related to the place with the door.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-5"}
|
| 38 |
+
{"id": "wv-37", "text": "Good rule of yours.", "type": "rule", "entity": "Good", "source_chunk": "jekyll_hyde-6"}
|
| 39 |
+
{"id": "wv-38", "text": "Man of the name of Hyde walked over the child.", "type": "event", "entity": "Hyde", "source_chunk": "jekyll_hyde-6"}
|
| 40 |
+
{"id": "wv-39", "text": "Weight of consideration during conversation.", "type": "setting", "entity": "Weight", "source_chunk": "jekyll_hyde-6"}
|
| 41 |
+
{"id": "wv-40", "text": "Lesson to say nothing; bargain to never refer to this again.", "type": "event", "entity": "Lesson", "source_chunk": "jekyll_hyde-6"}
|
| 42 |
+
{"id": "wv-41", "text": "Mr. Utterson came home to his bachelor house in sombre spirits.", "type": "location", "entity": "bachelor house", "source_chunk": "jekyll_hyde-7"}
|
| 43 |
+
{"id": "wv-42", "text": "It was his custom of a Sunday, when this meal was over, to sit close by the fire.", "type": "setting", "entity": "Sunday dinner", "source_chunk": "jekyll_hyde-7"}
|
| 44 |
+
{"id": "wv-43", "text": "Mr. Utterson opened his safe and studied the contents of Dr. Jekyll’s Will.", "type": "event", "entity": "reading of Dr. Jekyll's Will", "source_chunk": "jekyll_hyde-7"}
|
| 45 |
+
{"id": "wv-44", "text": "In case of Dr. Jekyll’s disappearance or unexplained absence for any period exceeding three calendar months, Edward Hyde should step into Dr. Jekyll’s shoes.", "type": "rule", "entity": "In", "source_chunk": "jekyll_hyde-7"}
|
| 46 |
+
{"id": "wv-45", "text": "This document had long been the lawyer’s eyesore.", "type": "organization", "entity": "lawyer", "source_chunk": "jekyll_hyde-7"}
|
| 47 |
+
{"id": "wv-46", "text": "It offended him both as a lawyer and as a lover of the sane and customary sides of life.", "type": "event", "entity": "indignation towards Mr. Hyde", "source_chunk": "jekyll_hyde-7"}
|
| 48 |
+
{"id": "wv-47", "text": "Cavendish Square, that citadel of medicine, where Dr. Lanyon had his house and received his crowding patients.", "type": "location", "entity": "Cavendish Square", "source_chunk": "jekyll_hyde-8"}
|
| 49 |
+
{"id": "wv-48", "text": "Dr. Lanyon had his house and received his crowding patients.", "type": "organization", "entity": "Dr. Lanyon's practice", "source_chunk": "jekyll_hyde-8"}
|
| 50 |
+
{"id": "wv-49", "text": "Utterson visits Dr. Lanyon to discuss Henry Jekyll.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-8"}
|
| 51 |
+
{"id": "wv-50", "text": "Old friends respect each other and enjoy each other's company.", "type": "rule", "entity": "Old", "source_chunk": "jekyll_hyde-8"}
|
| 52 |
+
{"id": "wv-51", "text": "Dining-room where Dr. Lanyon sat alone over his wine.", "type": "setting", "entity": "Dining", "source_chunk": "jekyll_hyde-8"}
|
| 53 |
+
{"id": "wv-52", "text": "Utterson expresses concern about Jekyll's mental state.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-8"}
|
| 54 |
+
{"id": "wv-53", "text": "Mr. Utterson reflects on a friend's scientific disagreements.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-9"}
|
| 55 |
+
{"id": "wv-54", "text": "Mr. Utterson inquires about a protégé named Hyde.", "type": "event", "entity": "Hyde", "source_chunk": "jekyll_hyde-9"}
|
| 56 |
+
{"id": "wv-55", "text": "Mr. Utterson's dwelling is near a church with bells striking six o'clock.", "type": "setting", "entity": "Mr. Utterson’s dwelling", "source_chunk": "jekyll_hyde-9"}
|
| 57 |
+
{"id": "wv-56", "text": "Imagery of a nocturnal city with a field of lamps.", "type": "setting", "entity": "nocturnal city", "source_chunk": "jekyll_hyde-9"}
|
| 58 |
+
{"id": "wv-57", "text": "Mr. Utterson experiences a night of little ease, troubled by questions.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-9"}
|
| 59 |
+
{"id": "wv-58", "text": "Mr. Utterson envisions a child being trodden down by a man.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-9"}
|
| 60 |
+
{"id": "wv-59", "text": "Mr. Utterson imagines a friend asleep and dreaming.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-9"}
|
| 61 |
+
{"id": "wv-60", "text": "Room in a rich house", "type": "setting", "entity": "Room", "source_chunk": "jekyll_hyde-10"}
|
| 62 |
+
{"id": "wv-61", "text": "Lawyer's curiosity to behold the features of Mr. Hyde grows", "type": "event", "entity": "Mr. Hyde", "source_chunk": "jekyll_hyde-10"}
|
| 63 |
+
{"id": "wv-62", "text": "Mr. Utterson begins to haunt the door in the by-street of shops", "type": "event", "entity": "Mr. Utterson", "source_chunk": "jekyll_hyde-10"}
|
| 64 |
+
{"id": "wv-63", "text": "Curiosity about mysterious things can lighten when examined", "type": "rule", "entity": "Curiosity", "source_chunk": "jekyll_hyde-10"}
|
| 65 |
+
{"id": "wv-64", "text": "Mr. Utterson's chosen post for waiting", "type": "location", "entity": "by-street of shops", "source_chunk": "jekyll_hyde-10"}
|
| 66 |
+
{"id": "wv-65", "text": "Night setting under the fogged city moon", "type": "setting", "entity": "fogged city moon", "source_chunk": "jekyll_hyde-10"}
|
| 67 |
+
{"id": "wv-66", "text": "Lawyer waits at his post to confront Mr. Hyde.", "type": "event", "entity": "Lawyer", "source_chunk": "jekyll_hyde-11"}
|
| 68 |
+
{"id": "wv-67", "text": "Nighttime in London, described as solitary and silent with clean streets.", "type": "setting", "entity": "London", "source_chunk": "jekyll_hyde-11"}
|
| 69 |
+
{"id": "wv-68", "text": "Lawyer has a superstitious prevision of success during his patrol.", "type": "rule", "entity": "Lawyer", "source_chunk": "jekyll_hyde-11"}
|
| 70 |
+
{"id": "wv-69", "text": "Mr. Hyde approaches the door, drawing a key from his pocket.", "type": "event", "entity": "Mr. Hyde", "source_chunk": "jekyll_hyde-11"}
|
| 71 |
+
{"id": "wv-70", "text": "Mr. Utterson identifies Mr. Hyde and touches him on the shoulder.", "type": "event", "entity": "Mr. Utterson", "source_chunk": "jekyll_hyde-11"}
|
| 72 |
+
{"id": "wv-71", "text": "Mr. Utterson is an old friend of Dr. Jekyll.", "type": "organization", "entity": "Dr. Jekyll", "source_chunk": "jekyll_hyde-12"}
|
| 73 |
+
{"id": "wv-72", "text": "Mr. Hyde gave a number of a street in Soho.", "type": "location", "entity": "Soho", "source_chunk": "jekyll_hyde-12"}
|
| 74 |
+
{"id": "wv-73", "text": "Mr. Utterson and Mr. Hyde meet and discuss Dr. Jekyll.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-12"}
|
| 75 |
+
{"id": "wv-74", "text": "Mr. Utterson requests to see Mr. Hyde's face.", "type": "rule", "entity": "Mr", "source_chunk": "jekyll_hyde-12"}
|
| 76 |
+
{"id": "wv-75", "text": "Mr. Hyde unlocks the door and disappears into the house.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-12"}
|
| 77 |
+
{"id": "wv-76", "text": "Mr. Hyde left the lawyer, causing disquietude.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-13"}
|
| 78 |
+
{"id": "wv-77", "text": "Lawyer debated a perplexing problem while walking.", "type": "event", "entity": "Lawyer", "source_chunk": "jekyll_hyde-13"}
|
| 79 |
+
{"id": "wv-78", "text": "Disgust, loathing, and fear can arise from unknown sources.", "type": "rule", "entity": "Disgust", "source_chunk": "jekyll_hyde-13"}
|
| 80 |
+
{"id": "wv-79", "text": "Square of ancient, handsome houses, now decayed.", "type": "setting", "entity": "Square", "source_chunk": "jekyll_hyde-13"}
|
| 81 |
+
{"id": "wv-80", "text": "House occupied entirely, exuding wealth and comfort.", "type": "location", "entity": "Dr. Jekyll's house", "source_chunk": "jekyll_hyde-13"}
|
| 82 |
+
{"id": "wv-81", "text": "Various professions reside in the decayed houses.", "type": "organization", "entity": "map-engravers, architects, shady lawyers", "source_chunk": "jekyll_hyde-13"}
|
| 83 |
+
{"id": "wv-82", "text": "Servant opened the door for Mr. Utterson.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-13"}
|
| 84 |
+
{"id": "wv-83", "text": "Large, low-roofed, comfortable hall paved with flags, warmed by a bright, open fire.", "type": "location", "entity": "hall", "source_chunk": "jekyll_hyde-14"}
|
| 85 |
+
{"id": "wv-84", "text": "Utterson speaks of the hall as the pleasantest room in London.", "type": "setting", "entity": "London", "source_chunk": "jekyll_hyde-14"}
|
| 86 |
+
{"id": "wv-85", "text": "Utterson visits Dr. Jekyll's home and learns that Jekyll is not at home.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-14"}
|
| 87 |
+
{"id": "wv-86", "text": "All orders to obey Mr. Hyde.", "type": "organization", "entity": "servants", "source_chunk": "jekyll_hyde-14"}
|
| 88 |
+
{"id": "wv-87", "text": "Mr. Hyde has a key and can enter the house when Dr. Jekyll is away.", "type": "rule", "entity": "Mr", "source_chunk": "jekyll_hyde-14"}
|
| 89 |
+
{"id": "wv-88", "text": "Utterson sees Mr. Hyde enter by the old dissecting room.", "type": "event", "entity": "Mr. Hyde", "source_chunk": "jekyll_hyde-14"}
|
| 90 |
+
{"id": "wv-89", "text": "Lawyer reflects on Harry Jekyll's troubled state and past sins.", "type": "event", "entity": "Lawyer", "source_chunk": "jekyll_hyde-15"}
|
| 91 |
+
{"id": "wv-90", "text": "No statute of limitations exists for sins.", "type": "rule", "entity": "law of God", "source_chunk": "jekyll_hyde-15"}
|
| 92 |
+
{"id": "wv-91", "text": "Lawyer feels heavy-hearted while returning home.", "type": "setting", "entity": "Lawyer", "source_chunk": "jekyll_hyde-15"}
|
| 93 |
+
{"id": "wv-92", "text": "Lawyer contemplates the dark secrets of Master Hyde.", "type": "event", "entity": "Master Hyde", "source_chunk": "jekyll_hyde-15"}
|
| 94 |
+
{"id": "wv-93", "text": "Lawyer worries about Hyde's potential impatience to inherit Jekyll's estate.", "type": "event", "entity": "Harry Jekyll", "source_chunk": "jekyll_hyde-15"}
|
| 95 |
+
{"id": "wv-94", "text": "Lawyer resolves to take action regarding Jekyll's situation.", "type": "event", "entity": "Lawyer", "source_chunk": "jekyll_hyde-15"}
|
| 96 |
+
{"id": "wv-95", "text": "Dr. Jekyll hosted a dinner for old cronies.", "type": "event", "entity": "Dr", "source_chunk": "jekyll_hyde-16"}
|
| 97 |
+
{"id": "wv-96", "text": "Utterson often remained behind after gatherings.", "type": "rule", "entity": "Utterson", "source_chunk": "jekyll_hyde-16"}
|
| 98 |
+
{"id": "wv-97", "text": "A warm and pleasant dinner atmosphere.", "type": "setting", "entity": null, "source_chunk": "jekyll_hyde-16"}
|
| 99 |
+
{"id": "wv-98", "text": "Lanyon is described as a hide-bound pedant and a good fellow.", "type": "organization", "entity": "Lanyon", "source_chunk": "jekyll_hyde-16"}
|
| 100 |
+
{"id": "wv-99", "text": "Utterson expressed concern about Jekyll's will.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-16"}
|
| 101 |
+
{"id": "wv-100", "text": "Utterson disapproved of Jekyll's will.", "type": "rule", "entity": "Utterson", "source_chunk": "jekyll_hyde-16"}
|
| 102 |
+
{"id": "wv-101", "text": "Utterson learned something about young Hyde.", "type": "event", "entity": "Hyde", "source_chunk": "jekyll_hyde-16"}
|
| 103 |
+
{"id": "wv-102", "text": "Doctor expresses discomfort about discussing young Hyde.", "type": "event", "entity": "Doctor", "source_chunk": "jekyll_hyde-17"}
|
| 104 |
+
{"id": "wv-103", "text": "Doctor insists on keeping matters private and not discussing them further.", "type": "rule", "entity": "Doctor", "source_chunk": "jekyll_hyde-17"}
|
| 105 |
+
{"id": "wv-104", "text": "Conversation takes place in a private setting, indicated by the request to let the matter sleep.", "type": "setting", "entity": "Conversation", "source_chunk": "jekyll_hyde-17"}
|
| 106 |
+
{"id": "wv-105", "text": "Utterson is portrayed as a trusted friend and confidant.", "type": "organization", "entity": "Utterson", "source_chunk": "jekyll_hyde-17"}
|
| 107 |
+
{"id": "wv-106", "text": "Fire is present, indicating a warm, intimate atmosphere during the conversation.", "type": "location", "entity": "Fire", "source_chunk": "jekyll_hyde-17"}
|
| 108 |
+
{"id": "wv-107", "text": "Jekyll expresses concern for Hyde and asks Utterson to help him.", "type": "event", "entity": "Jekyll", "source_chunk": "jekyll_hyde-18"}
|
| 109 |
+
{"id": "wv-108", "text": "Jekyll requests Utterson to ensure justice for Hyde.", "type": "rule", "entity": "Jekyll", "source_chunk": "jekyll_hyde-18"}
|
| 110 |
+
{"id": "wv-109", "text": "Utterson is a lawyer who is asked to assist Hyde.", "type": "organization", "entity": "Utterson", "source_chunk": "jekyll_hyde-18"}
|
| 111 |
+
{"id": "wv-110", "text": "Jekyll is concerned about his legacy and the treatment of Hyde.", "type": "setting", "entity": "Jekyll", "source_chunk": "jekyll_hyde-18"}
|
| 112 |
+
{"id": "wv-111", "text": "Crime of singular ferocity occurred in London, notable due to high position of victim.", "type": "event", "entity": "Crime", "source_chunk": "jekyll_hyde-19"}
|
| 113 |
+
{"id": "wv-112", "text": "Setting of the crime, city was startled by the event.", "type": "location", "entity": "London", "source_chunk": "jekyll_hyde-19"}
|
| 114 |
+
{"id": "wv-113", "text": "Time of year was October, with a cloudless night and full moon.", "type": "setting", "entity": "Time", "source_chunk": "jekyll_hyde-19"}
|
| 115 |
+
{"id": "wv-114", "text": "Maid servant living alone in a house near the river.", "type": "organization", "entity": "Maid", "source_chunk": "jekyll_hyde-19"}
|
| 116 |
+
{"id": "wv-115", "text": "Maid felt at peace with all men and thought kindly of the world.", "type": "rule", "entity": "Maid", "source_chunk": "jekyll_hyde-19"}
|
| 117 |
+
{"id": "wv-116", "text": "Maid recognized Mr. Hyde, whom she disliked, during the encounter.", "type": "event", "entity": "Mr. Hyde", "source_chunk": "jekyll_hyde-19"}
|
| 118 |
+
{"id": "wv-117", "text": "Mr. Hyde displayed anger and impatience during the encounter.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-19"}
|
| 119 |
+
{"id": "wv-118", "text": "Mr. Hyde attacked and killed Sir Danvers Carew in a violent outburst.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-20"}
|
| 120 |
+
{"id": "wv-119", "text": "Victim found in the middle of the lane, incredibly mangled.", "type": "location", "entity": "lane", "source_chunk": "jekyll_hyde-20"}
|
| 121 |
+
{"id": "wv-120", "text": "Maid called for the police after witnessing the murder.", "type": "organization", "entity": "police", "source_chunk": "jekyll_hyde-20"}
|
| 122 |
+
{"id": "wv-121", "text": "Murderer fled the scene, leaving the victim behind.", "type": "rule", "entity": "Murderer", "source_chunk": "jekyll_hyde-20"}
|
| 123 |
+
{"id": "wv-122", "text": "Scene described with horror, maid fainted at the sight.", "type": "setting", "entity": "Scene", "source_chunk": "jekyll_hyde-20"}
|
| 124 |
+
{"id": "wv-123", "text": "Mr. Utterson received a sealed envelope with the victim's name and address.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-20"}
|
| 125 |
+
{"id": "wv-124", "text": "Mr. Utterson recognized the victim as Sir Danvers Carew at the police station.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-20"}
|
| 126 |
+
{"id": "wv-125", "text": "Recognition of Sir Danvers Carew's body in the cell.", "type": "event", "entity": "Sir Danvers Carew", "source_chunk": "jekyll_hyde-21"}
|
| 127 |
+
{"id": "wv-126", "text": "Discussion of Mr. Hyde's involvement in the incident.", "type": "event", "entity": "Hyde", "source_chunk": "jekyll_hyde-21"}
|
| 128 |
+
{"id": "wv-127", "text": "Professional ambition drives the officer to seek the perpetrator.", "type": "rule", "entity": "Professional", "source_chunk": "jekyll_hyde-21"}
|
| 129 |
+
{"id": "wv-128", "text": "Dismal quarter of Soho described as dark and nightmarish.", "type": "location", "entity": "Soho", "source_chunk": "jekyll_hyde-21"}
|
| 130 |
+
{"id": "wv-129", "text": "First fog of the season creates a gloomy atmosphere.", "type": "setting", "entity": "First", "source_chunk": "jekyll_hyde-21"}
|
| 131 |
+
{"id": "wv-130", "text": "Mr. Utterson offers to take the officer to Hyde's house.", "type": "event", "entity": "cab ride", "source_chunk": "jekyll_hyde-21"}
|
| 132 |
+
{"id": "wv-131", "text": "A district of some city in a nightmare, described as dingy with a foggy atmosphere.", "type": "setting", "entity": null, "source_chunk": "jekyll_hyde-22"}
|
| 133 |
+
{"id": "wv-132", "text": "Presence of a gin palace in the street.", "type": "location", "entity": "gin palace", "source_chunk": "jekyll_hyde-22"}
|
| 134 |
+
{"id": "wv-133", "text": "A low French eating house is mentioned in the street.", "type": "location", "entity": "low French eating house", "source_chunk": "jekyll_hyde-22"}
|
| 135 |
+
{"id": "wv-134", "text": "A shop selling penny numbers and twopenny salads is present.", "type": "location", "entity": "shop for the retail of penny numbers and twopenny salads", "source_chunk": "jekyll_hyde-22"}
|
| 136 |
+
{"id": "wv-135", "text": "Mr. Hyde was not at home and had irregular habits.", "type": "event", "entity": "Mr. Hyde's absence", "source_chunk": "jekyll_hyde-22"}
|
| 137 |
+
{"id": "wv-136", "text": "Inspector Newcomen is associated with Scotland Yard.", "type": "organization", "entity": "Scotland Yard", "source_chunk": "jekyll_hyde-22"}
|
| 138 |
+
{"id": "wv-137", "text": "Law and its officers instill a sense of terror even in honest individuals.", "type": "rule", "entity": "Law", "source_chunk": "jekyll_hyde-22"}
|
| 139 |
+
{"id": "wv-138", "text": "The old woman expresses joy at the news of Mr. Hyde being in trouble.", "type": "event", "entity": "Mr. Hyde's trouble", "source_chunk": "jekyll_hyde-22"}
|
| 140 |
+
{"id": "wv-139", "text": "House furnished with luxury and good taste, but recently ransacked.", "type": "setting", "entity": "House", "source_chunk": "jekyll_hyde-23"}
|
| 141 |
+
{"id": "wv-140", "text": "Rooms showed signs of having been hurriedly ransacked; clothes on the floor, drawers open.", "type": "event", "entity": "Rooms", "source_chunk": "jekyll_hyde-23"}
|
| 142 |
+
{"id": "wv-141", "text": "Inspector found a burnt cheque book and a stick, leading to suspicions about Mr. Hyde.", "type": "event", "entity": "Inspector", "source_chunk": "jekyll_hyde-23"}
|
| 143 |
+
{"id": "wv-142", "text": "Several thousand pounds found to be lying to the murderer's credit.", "type": "organization", "entity": "bank", "source_chunk": "jekyll_hyde-23"}
|
| 144 |
+
{"id": "wv-143", "text": "Money is considered vital to Mr. Hyde, as indicated by the inspector's comments.", "type": "rule", "entity": "Money", "source_chunk": "jekyll_hyde-23"}
|
| 145 |
+
{"id": "wv-144", "text": "Mr. Hyde had few familiars and could not be easily traced.", "type": "location", "entity": "Mr", "source_chunk": "jekyll_hyde-23"}
|
| 146 |
+
{"id": "wv-145", "text": "Witnesses described Mr. Hyde with a haunting sense of unexpressed deformity.", "type": "event", "entity": "Witnesses", "source_chunk": "jekyll_hyde-23"}
|
| 147 |
+
{"id": "wv-146", "text": "Mr. Utterson found his way to Dr. Jekyll’s door.", "type": "location", "entity": "Dr. Jekyll’s door", "source_chunk": "jekyll_hyde-24"}
|
| 148 |
+
{"id": "wv-147", "text": "Mr. Utterson was carried down to the building which was indifferently known as the laboratory.", "type": "location", "entity": "laboratory", "source_chunk": "jekyll_hyde-24"}
|
| 149 |
+
{"id": "wv-148", "text": "Mr. Utterson was carried down to the building which was indifferently known as the dissecting rooms.", "type": "location", "entity": "dissecting rooms", "source_chunk": "jekyll_hyde-24"}
|
| 150 |
+
{"id": "wv-149", "text": "Mr. Utterson crossed a yard which had once been a garden.", "type": "location", "entity": "garden", "source_chunk": "jekyll_hyde-24"}
|
| 151 |
+
{"id": "wv-150", "text": "Mr. Utterson was received in that part of his friend’s quarters for the first time.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-24"}
|
| 152 |
+
{"id": "wv-151", "text": "The theatre was once crowded with eager students and now lying gaunt and silent.", "type": "setting", "entity": "theatre", "source_chunk": "jekyll_hyde-24"}
|
| 153 |
+
{"id": "wv-152", "text": "Mr. Utterson was received into the doctor’s cabinet.", "type": "setting", "entity": "doctor’s cabinet", "source_chunk": "jekyll_hyde-24"}
|
| 154 |
+
{"id": "wv-153", "text": "The cabinet looked out upon the court by three dusty windows barred with iron.", "type": "setting", "entity": "court", "source_chunk": "jekyll_hyde-24"}
|
| 155 |
+
{"id": "wv-154", "text": "Dr. Jekyll looked deathly sick when Mr. Utterson arrived.", "type": "event", "entity": "Dr", "source_chunk": "jekyll_hyde-24"}
|
| 156 |
+
{"id": "wv-155", "text": "Carew was Mr. Utterson's client.", "type": "organization", "entity": "Carew", "source_chunk": "jekyll_hyde-24"}
|
| 157 |
+
{"id": "wv-156", "text": "Utterson expresses concern about the implications of Jekyll's relationship with Hyde.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-25"}
|
| 158 |
+
{"id": "wv-157", "text": "Jekyll binds his honour to Utterson, indicating a moral obligation.", "type": "rule", "entity": "Jekyll", "source_chunk": "jekyll_hyde-25"}
|
| 159 |
+
{"id": "wv-158", "text": "Jekyll contemplates whether to show a letter to the police.", "type": "organization", "entity": "police", "source_chunk": "jekyll_hyde-25"}
|
| 160 |
+
{"id": "wv-159", "text": "The conversation takes place in a dining-room.", "type": "setting", "entity": "dining-room", "source_chunk": "jekyll_hyde-25"}
|
| 161 |
+
{"id": "wv-160", "text": "Jekyll declares he is done with Hyde and expresses concern for his own character.", "type": "event", "entity": "Jekyll", "source_chunk": "jekyll_hyde-25"}
|
| 162 |
+
{"id": "wv-161", "text": "Hyde writes a letter to Jekyll, indicating he has means of escape.", "type": "event", "entity": "Hyde", "source_chunk": "jekyll_hyde-25"}
|
| 163 |
+
{"id": "wv-162", "text": "Utterson learns about a letter that was handed in without a postmark.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-26"}
|
| 164 |
+
{"id": "wv-163", "text": "Jekyll expresses loss of confidence in himself.", "type": "event", "entity": "Jekyll", "source_chunk": "jekyll_hyde-26"}
|
| 165 |
+
{"id": "wv-164", "text": "Utterson suspects Hyde intended to murder Jekyll.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-26"}
|
| 166 |
+
{"id": "wv-165", "text": "Jekyll reflects on having learned a significant lesson.", "type": "event", "entity": "Jekyll", "source_chunk": "jekyll_hyde-26"}
|
| 167 |
+
{"id": "wv-166", "text": "Letter possibly came from the laboratory door.", "type": "location", "entity": "laboratory", "source_chunk": "jekyll_hyde-26"}
|
| 168 |
+
{"id": "wv-167", "text": "Letter may have been written in the cabinet.", "type": "location", "entity": "cabinet", "source_chunk": "jekyll_hyde-26"}
|
| 169 |
+
{"id": "wv-168", "text": "Newsboys announce a shocking murder of an M.P.", "type": "event", "entity": "Newsboys", "source_chunk": "jekyll_hyde-26"}
|
| 170 |
+
{"id": "wv-169", "text": "M.P. is mentioned in relation to a shocking murder.", "type": "organization", "entity": "M.P.", "source_chunk": "jekyll_hyde-26"}
|
| 171 |
+
{"id": "wv-170", "text": "Utterson feels apprehension about the potential scandal affecting Jekyll.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-26"}
|
| 172 |
+
{"id": "wv-171", "text": "Decision-making process involves seeking advice.", "type": "event", "entity": "Decision", "source_chunk": "jekyll_hyde-27"}
|
| 173 |
+
{"id": "wv-172", "text": "Conversation takes place by the hearth with firelight.", "type": "setting", "entity": "hearth", "source_chunk": "jekyll_hyde-27"}
|
| 174 |
+
{"id": "wv-173", "text": "Fog covers the city, described as a drowned city.", "type": "location", "entity": "London", "source_chunk": "jekyll_hyde-27"}
|
| 175 |
+
{"id": "wv-174", "text": "Utterson is a lawyer, indicating a legal profession.", "type": "organization", "entity": "law firm", "source_chunk": "jekyll_hyde-27"}
|
| 176 |
+
{"id": "wv-175", "text": "Public feeling elicited by the sad business about Sir Danvers.", "type": "event", "entity": "Sir Danvers", "source_chunk": "jekyll_hyde-27"}
|
| 177 |
+
{"id": "wv-176", "text": "Secrecy maintained in professional relationships.", "type": "rule", "entity": "Secrecy", "source_chunk": "jekyll_hyde-27"}
|
| 178 |
+
{"id": "wv-177", "text": "Mr. Hyde's familiarity with the house raises suspicions.", "type": "event", "entity": "Mr. Hyde", "source_chunk": "jekyll_hyde-27"}
|
| 179 |
+
{"id": "wv-178", "text": "Public feeling elicited by Sir Danvers' situation.", "type": "event", "entity": "Public", "source_chunk": "jekyll_hyde-28"}
|
| 180 |
+
{"id": "wv-179", "text": "Utterson receives a document in a murderer's handwriting.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-28"}
|
| 181 |
+
{"id": "wv-180", "text": "Guest compares two sheets of paper for handwriting similarities.", "type": "event", "entity": "Guest", "source_chunk": "jekyll_hyde-28"}
|
| 182 |
+
{"id": "wv-181", "text": "Utterson instructs Guest to keep the note private.", "type": "rule", "entity": "Utterson", "source_chunk": "jekyll_hyde-28"}
|
| 183 |
+
{"id": "wv-182", "text": "Utterson locks the note into his safe.", "type": "setting", "entity": "Utterson", "source_chunk": "jekyll_hyde-28"}
|
| 184 |
+
{"id": "wv-183", "text": "Utterson suspects Dr. Jekyll of forging for a murderer.", "type": "organization", "entity": "Dr. Jekyll", "source_chunk": "jekyll_hyde-28"}
|
| 185 |
+
{"id": "wv-184", "text": "Death of Sir Danvers was resented as a public injury.", "type": "event", "entity": "death of Sir Danvers", "source_chunk": "jekyll_hyde-29"}
|
| 186 |
+
{"id": "wv-185", "text": "Mr. Hyde disappeared out of the ken of the police as though he had never existed.", "type": "event", "entity": "disappearance of Mr. Hyde", "source_chunk": "jekyll_hyde-29"}
|
| 187 |
+
{"id": "wv-186", "text": "Much of Mr. Hyde's past was unearthed, revealing tales of cruelty and a vile life.", "type": "rule", "entity": "Much", "source_chunk": "jekyll_hyde-29"}
|
| 188 |
+
{"id": "wv-187", "text": "Mr. Hyde left the house in Soho on the morning of the murder.", "type": "setting", "entity": "Soho", "source_chunk": "jekyll_hyde-29"}
|
| 189 |
+
{"id": "wv-188", "text": "With Mr. Hyde's disappearance, a new life began for Dr. Jekyll.", "type": "event", "entity": "new life for Dr. Jekyll", "source_chunk": "jekyll_hyde-29"}
|
| 190 |
+
{"id": "wv-189", "text": "Utterson dined at Dr. Jekyll's with a small party including Lanyon.", "type": "event", "entity": "dinner with Utterson and Lanyon", "source_chunk": "jekyll_hyde-29"}
|
| 191 |
+
{"id": "wv-190", "text": "Utterson found the return of solitude to weigh upon his spirits.", "type": "event", "entity": "return of solitude", "source_chunk": "jekyll_hyde-29"}
|
| 192 |
+
{"id": "wv-191", "text": "Dr. Jekyll was confined to the house and saw no one on multiple occasions.", "type": "event", "entity": "refusal of visits", "source_chunk": "jekyll_hyde-29"}
|
| 193 |
+
{"id": "wv-192", "text": "Utterson visits Dr. Lanyon and observes his physical and mental decline.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-30"}
|
| 194 |
+
{"id": "wv-193", "text": "Lanyon declares himself a doomed man after experiencing a shock.", "type": "event", "entity": "Lanyon", "source_chunk": "jekyll_hyde-30"}
|
| 195 |
+
{"id": "wv-194", "text": "Lanyon expresses a desire to no longer discuss Dr. Jekyll, whom he regards as dead.", "type": "rule", "entity": "Lanyon", "source_chunk": "jekyll_hyde-30"}
|
| 196 |
+
{"id": "wv-195", "text": "Utterson is admitted to Lanyon's home, indicating a place of social interaction.", "type": "setting", "entity": "Lanyon's residence", "source_chunk": "jekyll_hyde-30"}
|
| 197 |
+
{"id": "wv-196", "text": "Utterson reflects on the inevitability of death and the value of life.", "type": "location", "entity": "Utterson", "source_chunk": "jekyll_hyde-30"}
|
| 198 |
+
{"id": "wv-197", "text": "Utterson receives a long answer from Jekyll, expressing a desire for extreme seclusion.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-31"}
|
| 199 |
+
{"id": "wv-198", "text": "Jekyll insists on never meeting Lanyon again.", "type": "rule", "entity": "Jekyll", "source_chunk": "jekyll_hyde-31"}
|
| 200 |
+
{"id": "wv-199", "text": "Dr. Lanyon takes to his bed and dies shortly after.", "type": "event", "entity": "Dr. Lanyon", "source_chunk": "jekyll_hyde-31"}
|
| 201 |
+
{"id": "wv-200", "text": "Jekyll's home is described as a place where Utterson feels excluded.", "type": "setting", "entity": "Jekyll", "source_chunk": "jekyll_hyde-31"}
|
| 202 |
+
{"id": "wv-201", "text": "Utterson reflects on the drastic change in Jekyll's life and mental state.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-31"}
|
| 203 |
+
{"id": "wv-202", "text": "Utterson is asked to respect Jekyll's silence regarding his troubles.", "type": "rule", "entity": "Utterson", "source_chunk": "jekyll_hyde-31"}
|
| 204 |
+
{"id": "wv-203", "text": "Dr. Lanyon took to his bed and died within a fortnight.", "type": "event", "entity": "Dr. Lanyon", "source_chunk": "jekyll_hyde-32"}
|
| 205 |
+
{"id": "wv-204", "text": "Utterson was sadly affected at the funeral.", "type": "event", "entity": "funeral", "source_chunk": "jekyll_hyde-32"}
|
| 206 |
+
{"id": "wv-205", "text": "Envelope addressed to Utterson marked 'PRIVATE' and to be destroyed unread in case of his predecease.", "type": "rule", "entity": "Envelope", "source_chunk": "jekyll_hyde-32"}
|
| 207 |
+
{"id": "wv-206", "text": "Another enclosure marked 'not to be opened till the death or disappearance of Dr. Henry Jekyll.'", "type": "rule", "entity": "Dr. Henry Jekyll", "source_chunk": "jekyll_hyde-32"}
|
| 208 |
+
{"id": "wv-207", "text": "Utterson is a trustee with obligations of professional honour and faith to his dead friend.", "type": "organization", "entity": "Utterson", "source_chunk": "jekyll_hyde-32"}
|
| 209 |
+
{"id": "wv-208", "text": "Utterson locked the door of his business room and sat by the light of a melancholy candle.", "type": "setting", "entity": "business room", "source_chunk": "jekyll_hyde-32"}
|
| 210 |
+
{"id": "wv-209", "text": "Utterson experienced disquiet and fear regarding his surviving friend.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-32"}
|
| 211 |
+
{"id": "wv-210", "text": "open city", "type": "location", "entity": "open city", "source_chunk": "jekyll_hyde-33"}
|
| 212 |
+
{"id": "wv-211", "text": "house of voluntary bondage", "type": "location", "entity": "house of voluntary bondage", "source_chunk": "jekyll_hyde-33"}
|
| 213 |
+
{"id": "wv-212", "text": "cabinet over the laboratory", "type": "setting", "entity": null, "source_chunk": "jekyll_hyde-33"}
|
| 214 |
+
{"id": "wv-213", "text": "doctor confined himself", "type": "event", "entity": null, "source_chunk": "jekyll_hyde-33"}
|
| 215 |
+
{"id": "wv-214", "text": "Utterson fell off in frequency of visits", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-33"}
|
| 216 |
+
{"id": "wv-215", "text": "Mr. Utterson and Mr. Enfield walk through a by-street and stop in front of a door.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-34"}
|
| 217 |
+
{"id": "wv-216", "text": "Mr. Enfield declares that the story of Mr. Hyde is at an end.", "type": "event", "entity": "Mr. Hyde", "source_chunk": "jekyll_hyde-34"}
|
| 218 |
+
{"id": "wv-217", "text": "Utterson expresses unease about Dr. Jekyll's well-being.", "type": "event", "entity": "Dr. Jekyll", "source_chunk": "jekyll_hyde-34"}
|
| 219 |
+
{"id": "wv-218", "text": "The court is described as cool, damp, and full of premature twilight.", "type": "setting", "entity": "court", "source_chunk": "jekyll_hyde-34"}
|
| 220 |
+
{"id": "wv-219", "text": "Utterson is identified as a lawyer.", "type": "organization", "entity": "lawyer", "source_chunk": "jekyll_hyde-34"}
|
| 221 |
+
{"id": "wv-220", "text": "Dr. Jekyll feels he cannot go out and socialize.", "type": "rule", "entity": "Dr", "source_chunk": "jekyll_hyde-34"}
|
| 222 |
+
{"id": "wv-221", "text": "Doctor's expression changes to abject terror and despair.", "type": "event", "entity": "Doctor", "source_chunk": "jekyll_hyde-35"}
|
| 223 |
+
{"id": "wv-222", "text": "Gentlemen traverse a by-street in silence.", "type": "location", "entity": "by-street", "source_chunk": "jekyll_hyde-35"}
|
| 224 |
+
{"id": "wv-223", "text": "Gentlemen enter a neighbouring thoroughfare with some stirrings of life.", "type": "location", "entity": "neighbouring thoroughfare", "source_chunk": "jekyll_hyde-35"}
|
| 225 |
+
{"id": "wv-224", "text": "Silence observed after witnessing the doctor's terror.", "type": "rule", "entity": "Silence", "source_chunk": "jekyll_hyde-35"}
|
| 226 |
+
{"id": "wv-225", "text": "Mr. Utterson expresses a plea for forgiveness.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-35"}
|
| 227 |
+
{"id": "wv-226", "text": "Mr. Utterson receives a visit from Poole.", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-36"}
|
| 228 |
+
{"id": "wv-227", "text": "Poole expresses fear about the doctor being shut up in the cabinet.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-36"}
|
| 229 |
+
{"id": "wv-228", "text": "Poole mentions he has been afraid for about a week.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-36"}
|
| 230 |
+
{"id": "wv-229", "text": "Poole suggests there has been foul play.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-36"}
|
| 231 |
+
{"id": "wv-230", "text": "A wild, cold night in March with a pale moon.", "type": "setting", "entity": "March", "source_chunk": "jekyll_hyde-36"}
|
| 232 |
+
{"id": "wv-231", "text": "Doctor is shut up in the cabinet.", "type": "location", "entity": "cabinet", "source_chunk": "jekyll_hyde-36"}
|
| 233 |
+
{"id": "wv-232", "text": "Mr. Utterson is a lawyer.", "type": "organization", "entity": "lawyer", "source_chunk": "jekyll_hyde-36"}
|
| 234 |
+
{"id": "wv-233", "text": "wild, cold, seasonable night of March with a pale moon and flying wrack", "type": "setting", "entity": "March", "source_chunk": "jekyll_hyde-37"}
|
| 235 |
+
{"id": "wv-234", "text": "part of London unusually bare of passengers", "type": "location", "entity": "London", "source_chunk": "jekyll_hyde-37"}
|
| 236 |
+
{"id": "wv-235", "text": "Mr. Utterson felt a crushing anticipation of calamity", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-37"}
|
| 237 |
+
{"id": "wv-236", "text": "square full of wind and dust with thin trees lashing along the railing", "type": "setting", "entity": null, "source_chunk": "jekyll_hyde-37"}
|
| 238 |
+
{"id": "wv-237", "text": "Poole showed signs of strangling anguish", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-37"}
|
| 239 |
+
{"id": "wv-238", "text": "servants stood huddled together like a flock of sheep", "type": "organization", "entity": "servants", "source_chunk": "jekyll_hyde-37"}
|
| 240 |
+
{"id": "wv-239", "text": "housemaid broke into hysterical whimpering upon seeing Mr. Utterson", "type": "event", "entity": "Mr", "source_chunk": "jekyll_hyde-37"}
|
| 241 |
+
{"id": "wv-240", "text": "Housemaid broke into hysterical whimpering.", "type": "event", "entity": "Housemaid", "source_chunk": "jekyll_hyde-38"}
|
| 242 |
+
{"id": "wv-241", "text": "Cook cried out in relief upon seeing Mr. Utterson.", "type": "event", "entity": "Cook", "source_chunk": "jekyll_hyde-38"}
|
| 243 |
+
{"id": "wv-242", "text": "Poole indicated that everyone was afraid.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-38"}
|
| 244 |
+
{"id": "wv-243", "text": "Maid wept loudly, causing a reaction from others.", "type": "event", "entity": "Maid", "source_chunk": "jekyll_hyde-38"}
|
| 245 |
+
{"id": "wv-244", "text": "Poole commanded the maid to be quiet.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-38"}
|
| 246 |
+
{"id": "wv-245", "text": "Poole asked the knife-boy for a candle.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-38"}
|
| 247 |
+
{"id": "wv-246", "text": "Poole warned Mr. Utterson not to enter if asked.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-38"}
|
| 248 |
+
{"id": "wv-247", "text": "Mr. Utterson followed Poole into the laboratory building.", "type": "location", "entity": "laboratory building", "source_chunk": "jekyll_hyde-38"}
|
| 249 |
+
{"id": "wv-248", "text": "They passed through the surgical theatre.", "type": "location", "entity": "surgical theatre", "source_chunk": "jekyll_hyde-38"}
|
| 250 |
+
{"id": "wv-249", "text": "Poole knocked on the cabinet door.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-38"}
|
| 251 |
+
{"id": "wv-250", "text": "A voice from within the cabinet refused to see anyone.", "type": "event", "entity": null, "source_chunk": "jekyll_hyde-38"}
|
| 252 |
+
{"id": "wv-251", "text": "Master made away with eight days ago, leading to strange occurrences.", "type": "event", "entity": "Master", "source_chunk": "jekyll_hyde-39"}
|
| 253 |
+
{"id": "wv-252", "text": "Master's voice is recognized by the butler, indicating familiarity and trust.", "type": "rule", "entity": "Master", "source_chunk": "jekyll_hyde-39"}
|
| 254 |
+
{"id": "wv-253", "text": "Great kitchen with an out fire and leaping beetles on the floor.", "type": "setting", "entity": "Great", "source_chunk": "jekyll_hyde-39"}
|
| 255 |
+
{"id": "wv-254", "text": "Crying for medicine from the entity in the cabinet, indicating desperation.", "type": "event", "entity": "Crying", "source_chunk": "jekyll_hyde-39"}
|
| 256 |
+
{"id": "wv-255", "text": "Orders sent to various chemists in town for specific medicine.", "type": "organization", "entity": "wholesale chemists", "source_chunk": "jekyll_hyde-39"}
|
| 257 |
+
{"id": "wv-256", "text": "Papers left with orders and complaints, indicating a sense of urgency.", "type": "event", "entity": "Papers", "source_chunk": "jekyll_hyde-39"}
|
| 258 |
+
{"id": "wv-257", "text": "Dr. Jekyll requests a search for a specific drug due to previous samples being impure.", "type": "event", "entity": "Dr", "source_chunk": "jekyll_hyde-40"}
|
| 259 |
+
{"id": "wv-258", "text": "Dr. Jekyll emphasizes the importance of obtaining pure drug samples.", "type": "rule", "entity": "Dr", "source_chunk": "jekyll_hyde-40"}
|
| 260 |
+
{"id": "wv-259", "text": "Dr. Jekyll communicates with Messrs. Maw regarding the quality of drug samples.", "type": "organization", "entity": "Messrs. Maw", "source_chunk": "jekyll_hyde-40"}
|
| 261 |
+
{"id": "wv-260", "text": "Poole describes entering the theatre from the garden where he saw Dr. Jekyll.", "type": "setting", "entity": "theatre", "source_chunk": "jekyll_hyde-40"}
|
| 262 |
+
{"id": "wv-261", "text": "Poole witnesses Dr. Jekyll in a state of distress while searching for the drug.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-40"}
|
| 263 |
+
{"id": "wv-262", "text": "Dr. Jekyll is seen wearing a mask, raising concerns about his identity.", "type": "event", "entity": "Dr", "source_chunk": "jekyll_hyde-40"}
|
| 264 |
+
{"id": "wv-263", "text": "Poole witnesses a masked figure that he believes is not his master.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-41"}
|
| 265 |
+
{"id": "wv-264", "text": "Utterson feels a duty to investigate the truth behind the masked figure.", "type": "rule", "entity": "Utterson", "source_chunk": "jekyll_hyde-41"}
|
| 266 |
+
{"id": "wv-265", "text": "The scene takes place in a cabinet where the masked figure is seen.", "type": "setting", "entity": "cabinet", "source_chunk": "jekyll_hyde-41"}
|
| 267 |
+
{"id": "wv-266", "text": "Utterson is identified as a lawyer who is concerned about his friend's well-being.", "type": "organization", "entity": "lawyer", "source_chunk": "jekyll_hyde-41"}
|
| 268 |
+
{"id": "wv-267", "text": "Poole expresses belief that murder has occurred.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-41"}
|
| 269 |
+
{"id": "wv-268", "text": "Poole asserts his long service allows him to recognize his master.", "type": "rule", "entity": "Poole", "source_chunk": "jekyll_hyde-41"}
|
| 270 |
+
{"id": "wv-269", "text": "Utterson and Poole prepare to break down a door.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-42"}
|
| 271 |
+
{"id": "wv-270", "text": "Utterson and Poole discuss the presence of a masked figure.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-42"}
|
| 272 |
+
{"id": "wv-271", "text": "An axe is mentioned to be in the theatre.", "type": "organization", "entity": "theatre", "source_chunk": "jekyll_hyde-42"}
|
| 273 |
+
{"id": "wv-272", "text": "Utterson expresses duty to ensure Poole is not a loser in their perilous situation.", "type": "rule", "entity": "Utterson", "source_chunk": "jekyll_hyde-42"}
|
| 274 |
+
{"id": "wv-273", "text": "The laboratory door is referenced as a point of entry for Mr. Hyde.", "type": "location", "entity": "laboratory", "source_chunk": "jekyll_hyde-42"}
|
| 275 |
+
{"id": "wv-274", "text": "Poole suspects the masked figure to be Mr. Hyde.", "type": "event", "entity": "Mr. Hyde", "source_chunk": "jekyll_hyde-42"}
|
| 276 |
+
{"id": "wv-275", "text": "Utterson acknowledges feeling something unsettling about Mr. Hyde.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-42"}
|
| 277 |
+
{"id": "wv-276", "text": "Poole describes a masked figure resembling a monkey jumping from among chemicals.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-43"}
|
| 278 |
+
{"id": "wv-277", "text": "Poole believes the masked figure was Mr. Hyde.", "type": "event", "entity": "Mr. Hyde", "source_chunk": "jekyll_hyde-43"}
|
| 279 |
+
{"id": "wv-278", "text": "Lawyer fears that Harry is killed and believes his murderer is still present.", "type": "event", "entity": "Harry", "source_chunk": "jekyll_hyde-43"}
|
| 280 |
+
{"id": "wv-279", "text": "Lawyer intends to force entry into the cabinet to confront the situation.", "type": "rule", "entity": "Lawyer", "source_chunk": "jekyll_hyde-43"}
|
| 281 |
+
{"id": "wv-280", "text": "Bradshaw and the boy are instructed to guard the laboratory door.", "type": "location", "entity": "laboratory", "source_chunk": "jekyll_hyde-43"}
|
| 282 |
+
{"id": "wv-281", "text": "London is described as humming solemnly around the characters.", "type": "setting", "entity": "London", "source_chunk": "jekyll_hyde-43"}
|
| 283 |
+
{"id": "wv-282", "text": "Characters wait silently in the shelter of the theatre.", "type": "event", "entity": "Characters", "source_chunk": "jekyll_hyde-43"}
|
| 284 |
+
{"id": "wv-283", "text": "Footfall moving to and fro along the cabinet floor.", "type": "event", "entity": "Footfall", "source_chunk": "jekyll_hyde-44"}
|
| 285 |
+
{"id": "wv-284", "text": "Poole mentions a break when a new sample comes from the chemist.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-44"}
|
| 286 |
+
{"id": "wv-285", "text": "Poole hears weeping, described as like a woman or a lost soul.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-44"}
|
| 287 |
+
{"id": "wv-286", "text": "Utterson demands to see Jekyll, threatening to use brute force.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-44"}
|
| 288 |
+
{"id": "wv-287", "text": "Utterson recognizes Hyde's voice instead of Jekyll's.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-44"}
|
| 289 |
+
{"id": "wv-288", "text": "Poole swings an axe to break down the door.", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-44"}
|
| 290 |
+
{"id": "wv-289", "text": "Quiet of the night.", "type": "setting", "entity": "Quiet", "source_chunk": "jekyll_hyde-44"}
|
| 291 |
+
{"id": "wv-290", "text": "Footfall and weeping occur in the cabinet.", "type": "location", "entity": "cabinet", "source_chunk": "jekyll_hyde-44"}
|
| 292 |
+
{"id": "wv-291", "text": "Besiegers broke down the door of a cabinet.", "type": "event", "entity": "Besiegers", "source_chunk": "jekyll_hyde-45"}
|
| 293 |
+
{"id": "wv-292", "text": "Cabinet contained a body, a fire glowing, and items laid out for tea.", "type": "setting", "entity": "cabinet", "source_chunk": "jekyll_hyde-45"}
|
| 294 |
+
{"id": "wv-293", "text": "Body of Edward Hyde was found, contorted and still twitching.", "type": "event", "entity": "Edward Hyde", "source_chunk": "jekyll_hyde-45"}
|
| 295 |
+
{"id": "wv-294", "text": "Utterson stated they had come too late to save or punish Hyde.", "type": "rule", "entity": "Utterson", "source_chunk": "jekyll_hyde-45"}
|
| 296 |
+
{"id": "wv-295", "text": "Building occupied by a theatre and a cabinet.", "type": "location", "entity": "theatre", "source_chunk": "jekyll_hyde-45"}
|
| 297 |
+
{"id": "wv-296", "text": "Setting described as commonplace that night in London.", "type": "location", "entity": "London", "source_chunk": "jekyll_hyde-45"}
|
| 298 |
+
{"id": "wv-297", "text": "The theatre to the door on the by-street.", "type": "location", "entity": "theatre", "source_chunk": "jekyll_hyde-46"}
|
| 299 |
+
{"id": "wv-298", "text": "Cellar filled with crazy lumber, mostly dating from the times of the surgeon who was Jekyll’s predecessor.", "type": "location", "entity": "cellar", "source_chunk": "jekyll_hyde-46"}
|
| 300 |
+
{"id": "wv-299", "text": "Thorough examination of empty closets and a cellar sealed by cobweb.", "type": "event", "entity": "Thorough", "source_chunk": "jekyll_hyde-46"}
|
| 301 |
+
{"id": "wv-300", "text": "Discovery of a locked door in the by-street with a rusty key nearby.", "type": "event", "entity": "Discovery", "source_chunk": "jekyll_hyde-46"}
|
| 302 |
+
{"id": "wv-301", "text": "Traces of chemical work found in the cabinet.", "type": "event", "entity": "Traces", "source_chunk": "jekyll_hyde-46"}
|
| 303 |
+
{"id": "wv-302", "text": "Kettle boiled over, indicating recent activity at the fireside.", "type": "event", "entity": "Kettle", "source_chunk": "jekyll_hyde-46"}
|
| 304 |
+
{"id": "wv-303", "text": "Fireside with easy-chair and tea things ready", "type": "setting", "entity": "Fireside", "source_chunk": "jekyll_hyde-47"}
|
| 305 |
+
{"id": "wv-304", "text": "Jekyll expressed great esteem for a pious work, annotated with blasphemies", "type": "event", "entity": "Jekyll", "source_chunk": "jekyll_hyde-47"}
|
| 306 |
+
{"id": "wv-305", "text": "Poole whispers about the cheval-glass having seen strange things", "type": "event", "entity": "Poole", "source_chunk": "jekyll_hyde-47"}
|
| 307 |
+
{"id": "wv-306", "text": "Utterson finds a will naming him instead of Edward Hyde", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-47"}
|
| 308 |
+
{"id": "wv-307", "text": "Will serves as testament in case of death and deed of gift in case of disappearance", "type": "rule", "entity": "Will", "source_chunk": "jekyll_hyde-47"}
|
| 309 |
+
{"id": "wv-308", "text": "Utterson receives a note from Jekyll indicating his imminent disappearance.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-48"}
|
| 310 |
+
{"id": "wv-309", "text": "Utterson and Poole discuss the implications of Jekyll's potential suicide.", "type": "event", "entity": "Utterson", "source_chunk": "jekyll_hyde-48"}
|
| 311 |
+
{"id": "wv-310", "text": "Utterson plans to send for the police after reading the documents.", "type": "organization", "entity": "police", "source_chunk": "jekyll_hyde-48"}
|
| 312 |
+
{"id": "wv-311", "text": "Utterson and Poole lock the door of the theatre behind them.", "type": "setting", "entity": "theatre", "source_chunk": "jekyll_hyde-48"}
|
| 313 |
+
{"id": "wv-312", "text": "Utterson decides to keep the contents of the paper secret to protect Jekyll's credit.", "type": "rule", "entity": "Utterson", "source_chunk": "jekyll_hyde-48"}
|
| 314 |
+
{"id": "wv-313", "text": "Letter received by Dr. Lanyon from Henry Jekyll on January 9.", "type": "event", "entity": "Letter", "source_chunk": "jekyll_hyde-49"}
|
| 315 |
+
{"id": "wv-314", "text": "Jekyll expresses urgency and desperation in letter.", "type": "event", "entity": "Jekyll", "source_chunk": "jekyll_hyde-49"}
|
| 316 |
+
{"id": "wv-315", "text": "Jekyll requests Lanyon to prioritize his request over other engagements.", "type": "rule", "entity": "Jekyll", "source_chunk": "jekyll_hyde-49"}
|
| 317 |
+
{"id": "wv-316", "text": "Lanyon instructed to go to Jekyll's house.", "type": "location", "entity": "Jekyll's house", "source_chunk": "jekyll_hyde-49"}
|
| 318 |
+
{"id": "wv-317", "text": "Poole, Jekyll's butler, is involved in the plan.", "type": "organization", "entity": "Poole", "source_chunk": "jekyll_hyde-49"}
|
| 319 |
+
{"id": "wv-318", "text": "Lanyon directed to force open Jekyll's cabinet.", "type": "setting", "entity": "cabinet", "source_chunk": "jekyll_hyde-49"}
|
| 320 |
+
{"id": "wv-319", "text": "Lanyon to retrieve specific items from Jekyll's cabinet.", "type": "event", "entity": "Lanyon", "source_chunk": "jekyll_hyde-49"}
|
| 321 |
+
{"id": "wv-320", "text": "Drawer to be carried back to Cavendish Square exactly as it stands.", "type": "location", "entity": "Cavendish Square", "source_chunk": "jekyll_hyde-50"}
|
| 322 |
+
{"id": "wv-321", "text": "Request to be alone in consulting room at midnight.", "type": "event", "entity": "Request", "source_chunk": "jekyll_hyde-50"}
|
| 323 |
+
{"id": "wv-322", "text": "Must admit a man presenting himself in the name of the sender.", "type": "rule", "entity": "Must", "source_chunk": "jekyll_hyde-50"}
|
| 324 |
+
{"id": "wv-323", "text": "Failure to follow arrangements could lead to death or shipwreck of reason.", "type": "event", "entity": "Failure", "source_chunk": "jekyll_hyde-50"}
|
| 325 |
+
{"id": "wv-324", "text": "Concern about the post-office failing to deliver the letter.", "type": "organization", "entity": "post-office", "source_chunk": "jekyll_hyde-50"}
|
| 326 |
+
{"id": "wv-325", "text": "Letter may not reach recipient until next morning.", "type": "event", "entity": "Letter", "source_chunk": "jekyll_hyde-51"}
|
| 327 |
+
{"id": "wv-326", "text": "If night passes without event, last seen of Henry Jekyll.", "type": "event", "entity": "Henry Jekyll", "source_chunk": "jekyll_hyde-51"}
|
| 328 |
+
{"id": "wv-327", "text": "Colleague drove straight to Jekyll’s house.", "type": "location", "entity": "Jekyll’s house", "source_chunk": "jekyll_hyde-51"}
|
| 329 |
+
{"id": "wv-328", "text": "Returned with drawer to Cavendish Square.", "type": "organization", "entity": "Cavendish Square", "source_chunk": "jekyll_hyde-51"}
|
| 330 |
+
{"id": "wv-329", "text": "Private cabinet conveniently entered from Dr. Denman’s surgical theatre.", "type": "setting", "entity": "Dr. Denman’s surgical theatre", "source_chunk": "jekyll_hyde-51"}
|
| 331 |
+
{"id": "wv-330", "text": "Colleague felt bound to do as requested despite doubts.", "type": "rule", "entity": "Colleague", "source_chunk": "jekyll_hyde-51"}
|
| 332 |
+
{"id": "wv-331", "text": "Butler received registered letter of instruction.", "type": "event", "entity": "Butler", "source_chunk": "jekyll_hyde-51"}
|
| 333 |
+
{"id": "wv-332", "text": "Locksmith and carpenter called to assist with door.", "type": "event", "entity": "Locksmith", "source_chunk": "jekyll_hyde-51"}
|
| 334 |
+
{"id": "wv-333", "text": "Door opened after two hours of work.", "type": "event", "entity": "Door", "source_chunk": "jekyll_hyde-51"}
|
| 335 |
+
{"id": "wv-334", "text": "Contents of drawer examined, revealing private manufacture.", "type": "event", "entity": "Contents", "source_chunk": "jekyll_hyde-51"}
|
| 336 |
+
{"id": "wv-335", "text": "Twelve o’clock had scarce rung out over London", "type": "setting", "entity": "London", "source_chunk": "jekyll_hyde-52"}
|
| 337 |
+
{"id": "wv-336", "text": "knocker sounded very gently on the door", "type": "event", "entity": "arrival of messenger", "source_chunk": "jekyll_hyde-52"}
|
| 338 |
+
{"id": "wv-337", "text": "Are you come from Dr. Jekyll?", "type": "organization", "entity": "Dr. Jekyll", "source_chunk": "jekyll_hyde-52"}
|
| 339 |
+
{"id": "wv-338", "text": "received by me in secret", "type": "rule", "entity": null, "source_chunk": "jekyll_hyde-52"}
|
| 340 |
+
{"id": "wv-339", "text": "dealing with a case of cerebral disease", "type": "event", "entity": "cerebral disease", "source_chunk": "jekyll_hyde-52"}
|
| 341 |
+
{"id": "wv-340", "text": "small man crouching against the pillars of the portico", "type": "location", "entity": "portico", "source_chunk": "jekyll_hyde-52"}
|
| 342 |
+
{"id": "wv-341", "text": "loaded an old revolver, that I might be found in some posture of self-defence", "type": "event", "entity": "self-defence", "source_chunk": "jekyll_hyde-52"}
|
| 343 |
+
{"id": "wv-342", "text": "Visitor enters consulting room after a searching glance into the darkness.", "type": "event", "entity": "Visitor", "source_chunk": "jekyll_hyde-53"}
|
| 344 |
+
{"id": "wv-343", "text": "Bright light of the consulting room contrasts with the darkness of the square.", "type": "location", "entity": "consulting room", "source_chunk": "jekyll_hyde-53"}
|
| 345 |
+
{"id": "wv-344", "text": "Policeman advancing with a bull’s eye open.", "type": "organization", "entity": "police", "source_chunk": "jekyll_hyde-53"}
|
| 346 |
+
{"id": "wv-345", "text": "Presence of policeman causes visitor to start and make greater haste.", "type": "rule", "entity": "Presence", "source_chunk": "jekyll_hyde-53"}
|
| 347 |
+
{"id": "wv-346", "text": "Atmosphere described as having a marked sinking of the pulse and incipient rigour.", "type": "setting", "entity": "Atmosphere", "source_chunk": "jekyll_hyde-53"}
|
| 348 |
+
{"id": "wv-347", "text": "Visitor's appearance causes disgustful curiosity.", "type": "event", "entity": "Visitor", "source_chunk": "jekyll_hyde-53"}
|
| 349 |
+
{"id": "wv-348", "text": "Visitor's clothing is described as ludicrous and abnormal.", "type": "setting", "entity": "Visitor", "source_chunk": "jekyll_hyde-53"}
|
| 350 |
+
{"id": "wv-349", "text": "Visitor expresses impatience and urgency regarding a piece of business.", "type": "event", "entity": "Visitor", "source_chunk": "jekyll_hyde-54"}
|
| 351 |
+
{"id": "wv-350", "text": "Visitor comes at the instance of Dr. Henry Jekyll.", "type": "organization", "entity": "Dr. Henry Jekyll", "source_chunk": "jekyll_hyde-54"}
|
| 352 |
+
{"id": "wv-351", "text": "Interaction occurs in a private space with a drawer covered by a sheet.", "type": "setting", "entity": "Interaction", "source_chunk": "jekyll_hyde-54"}
|
| 353 |
+
{"id": "wv-352", "text": "Politeness is expected in social interactions, as noted by the visitor's apology.", "type": "rule", "entity": "Politeness", "source_chunk": "jekyll_hyde-54"}
|
| 354 |
+
{"id": "wv-353", "text": "Visitor experiences physical symptoms of anxiety and hysteria.", "type": "event", "entity": "Visitor", "source_chunk": "jekyll_hyde-54"}
|
| 355 |
+
{"id": "wv-354", "text": "Visitor experiences immense relief upon uncovering the contents.", "type": "event", "entity": "Visitor", "source_chunk": "jekyll_hyde-55"}
|
| 356 |
+
{"id": "wv-355", "text": "Visitor prepares a chemical mixture that changes color and effervesces.", "type": "event", "entity": "Visitor", "source_chunk": "jekyll_hyde-55"}
|
| 357 |
+
{"id": "wv-356", "text": "Decision to allow visitor to leave with the glass or to pursue knowledge.", "type": "rule", "entity": "Decision", "source_chunk": "jekyll_hyde-55"}
|
| 358 |
+
{"id": "wv-357", "text": "Interaction occurs in a room with a table and a graduated glass.", "type": "setting", "entity": "Interaction", "source_chunk": "jekyll_hyde-55"}
|
| 359 |
+
{"id": "wv-358", "text": "Knowledge and power are presented as rewards for curiosity.", "type": "organization", "entity": "Knowledge", "source_chunk": "jekyll_hyde-55"}
|
| 360 |
+
{"id": "wv-359", "text": "A visitor drinks from a glass, leading to a transformation.", "type": "event", "entity": null, "source_chunk": "jekyll_hyde-56"}
|
| 361 |
+
{"id": "wv-360", "text": "Henry Jekyll appears transformed after the visitor drinks.", "type": "event", "entity": "Henry Jekyll", "source_chunk": "jekyll_hyde-56"}
|
| 362 |
+
{"id": "wv-361", "text": "Vows are mentioned, indicating a code of conduct in a profession.", "type": "rule", "entity": "Vows", "source_chunk": "jekyll_hyde-56"}
|
| 363 |
+
{"id": "wv-362", "text": "The scene takes place in a room.", "type": "setting", "entity": "The", "source_chunk": "jekyll_hyde-56"}
|
| 364 |
+
{"id": "wv-363", "text": "A new province of knowledge is suggested to be accessible.", "type": "location", "entity": null, "source_chunk": "jekyll_hyde-56"}
|
| 365 |
+
{"id": "wv-364", "text": "The narrator experiences terror and disbelief after witnessing the transformation.", "type": "event", "entity": "The", "source_chunk": "jekyll_hyde-56"}
|
| 366 |
+
{"id": "wv-365", "text": "Hyde known as the murderer of Carew.", "type": "event", "entity": "Hyde", "source_chunk": "jekyll_hyde-57"}
|
| 367 |
+
{"id": "wv-366", "text": "Moral turpitude causes horror and incredulity.", "type": "rule", "entity": "Moral", "source_chunk": "jekyll_hyde-57"}
|
| 368 |
+
{"id": "wv-367", "text": "Deadliest terror present at all hours.", "type": "setting", "entity": "Deadliest", "source_chunk": "jekyll_hyde-57"}
|
| 369 |
+
{"id": "wv-368", "text": "Days are numbered and death is imminent.", "type": "event", "entity": "Days", "source_chunk": "jekyll_hyde-57"}
|
| 370 |
+
{"id": "wv-369", "text": "Birth to a large fortune and excellent parts.", "type": "event", "entity": "Birth", "source_chunk": "jekyll_hyde-58"}
|
| 371 |
+
{"id": "wv-370", "text": "Concealment of pleasures due to high aspirations.", "type": "rule", "entity": "Concealment", "source_chunk": "jekyll_hyde-58"}
|
| 372 |
+
{"id": "wv-371", "text": "Reflection on progress and position in the world.", "type": "setting", "entity": "Reflection", "source_chunk": "jekyll_hyde-58"}
|
| 373 |
+
{"id": "wv-372", "text": "Morbid sense of shame regarding faults.", "type": "rule", "entity": "Morbid", "source_chunk": "jekyll_hyde-58"}
|
| 374 |
+
{"id": "wv-373", "text": "Commitment to a profound duplicity of life.", "type": "event", "entity": "Commitment", "source_chunk": "jekyll_hyde-58"}
|
| 375 |
+
{"id": "wv-374", "text": "Severance of good and ill within man's dual nature.", "type": "rule", "entity": "Severance", "source_chunk": "jekyll_hyde-58"}
|
| 376 |
+
{"id": "wv-375", "text": "Reflection on the hard law of life related to religion.", "type": "rule", "entity": "Reflection", "source_chunk": "jekyll_hyde-58"}
|
| 377 |
+
{"id": "wv-376", "text": "Scientific studies leading towards the mystic and transcendental.", "type": "event", "entity": "Scientific", "source_chunk": "jekyll_hyde-58"}
|
| 378 |
+
{"id": "wv-377", "text": "Discovery of the duality of man leading to a moral and intellectual struggle.", "type": "event", "entity": "Discovery", "source_chunk": "jekyll_hyde-59"}
|
| 379 |
+
{"id": "wv-378", "text": "Man is not truly one, but truly two, representing a duality in nature.", "type": "rule", "entity": "Man", "source_chunk": "jekyll_hyde-59"}
|
| 380 |
+
{"id": "wv-379", "text": "Consciousness as a battleground for conflicting moral and intellectual natures.", "type": "setting", "entity": "Consciousness", "source_chunk": "jekyll_hyde-59"}
|
| 381 |
+
{"id": "wv-380", "text": "Separation of moral and immoral identities to relieve life's burdens.", "type": "concept", "entity": "Separation", "source_chunk": "jekyll_hyde-59"}
|
| 382 |
+
{"id": "wv-381", "text": "Future scientific advancements will further explore the duality of man.", "type": "organization", "entity": "Future", "source_chunk": "jekyll_hyde-59"}
|
| 383 |
+
{"id": "wv-382", "text": "Doom and burden of life is bound for ever on man's shoulders.", "type": "rule", "entity": "Doom", "source_chunk": "jekyll_hyde-60"}
|
| 384 |
+
{"id": "wv-383", "text": "Attempt to cast off life's burden returns with more pressure.", "type": "event", "entity": "Attempt", "source_chunk": "jekyll_hyde-60"}
|
| 385 |
+
{"id": "wv-384", "text": "Side light began to shine upon the subject from the laboratory table.", "type": "setting", "entity": "laboratory", "source_chunk": "jekyll_hyde-60"}
|
| 386 |
+
{"id": "wv-385", "text": "Discovery of a drug that controls identity.", "type": "event", "entity": "Discovery", "source_chunk": "jekyll_hyde-60"}
|
| 387 |
+
{"id": "wv-386", "text": "Risk of death from drug that controls identity.", "type": "rule", "entity": "Risk", "source_chunk": "jekyll_hyde-60"}
|
| 388 |
+
{"id": "wv-387", "text": "Hesitation before testing the theory of identity change.", "type": "event", "entity": "Hesitation", "source_chunk": "jekyll_hyde-60"}
|
| 389 |
+
{"id": "wv-388", "text": "Compounded elements and drank potion leading to transformation.", "type": "event", "entity": "Compounded", "source_chunk": "jekyll_hyde-61"}
|
| 390 |
+
{"id": "wv-389", "text": "Nighttime, with inmates locked in slumber.", "type": "setting", "entity": "Nighttime", "source_chunk": "jekyll_hyde-61"}
|
| 391 |
+
{"id": "wv-390", "text": "Discovery of a profound potion leads to a moral and physical transformation.", "type": "rule", "entity": "Discovery", "source_chunk": "jekyll_hyde-61"}
|
| 392 |
+
{"id": "wv-391", "text": "Room without a mirror, later brought for transformations.", "type": "location", "entity": "Room", "source_chunk": "jekyll_hyde-61"}
|
| 393 |
+
{"id": "wv-392", "text": "Experiencing sensations of youth, lightness, and wickedness after potion.", "type": "event", "entity": "Experiencing", "source_chunk": "jekyll_hyde-61"}
|
| 394 |
+
{"id": "wv-393", "text": "House was locked in rigorous hours of slumber.", "type": "setting", "entity": "house", "source_chunk": "jekyll_hyde-62"}
|
| 395 |
+
{"id": "wv-394", "text": "First time seeing the appearance of Edward Hyde.", "type": "event", "entity": "appearance of Edward Hyde", "source_chunk": "jekyll_hyde-62"}
|
| 396 |
+
{"id": "wv-395", "text": "Evil side of nature was less robust and developed than good side.", "type": "rule", "entity": "Evil", "source_chunk": "jekyll_hyde-62"}
|
| 397 |
+
{"id": "wv-396", "text": "Evil is considered the lethal side of man.", "type": "rule", "entity": "Evil", "source_chunk": "jekyll_hyde-62"}
|
| 398 |
+
{"id": "wv-397", "text": "Stole through the corridors, feeling like a stranger in own house.", "type": "location", "entity": "corridors", "source_chunk": "jekyll_hyde-62"}
|
| 399 |
+
{"id": "wv-398", "text": "Human beings are commingled out of good and evil.", "type": "organization", "entity": "Human", "source_chunk": "jekyll_hyde-62"}
|
| 400 |
+
{"id": "wv-399", "text": "Wearing semblance of Edward Hyde caused visible misgiving in others.", "type": "event", "entity": "Wearing", "source_chunk": "jekyll_hyde-62"}
|
| 401 |
+
{"id": "wv-400", "text": "Human beings are commingled out of good and evil.", "type": "rule", "entity": "Human", "source_chunk": "jekyll_hyde-63"}
|
| 402 |
+
{"id": "wv-401", "text": "Conclusive experiment to determine loss of identity.", "type": "event", "entity": "experiment", "source_chunk": "jekyll_hyde-63"}
|
| 403 |
+
{"id": "wv-402", "text": "Preparation and consumption of the transformative drug.", "type": "setting", "entity": "cabinet", "source_chunk": "jekyll_hyde-63"}
|
| 404 |
+
{"id": "wv-403", "text": "Moment of decision regarding the nature of the experiment.", "type": "event", "entity": "cross-roads", "source_chunk": "jekyll_hyde-63"}
|
| 405 |
+
{"id": "wv-404", "text": "Drug has no discriminating action; it reveals true nature.", "type": "rule", "entity": "Drug", "source_chunk": "jekyll_hyde-63"}
|
| 406 |
+
{"id": "wv-405", "text": "Reference to captives of Philippi to illustrate transformation.", "type": "organization", "entity": "Philippi", "source_chunk": "jekyll_hyde-63"}
|
| 407 |
+
{"id": "wv-406", "text": "Temptation leading to moral decline.", "type": "event", "entity": "new power", "source_chunk": "jekyll_hyde-63"}
|
| 408 |
+
{"id": "wv-407", "text": "Life of study perceived as dry and unwelcome.", "type": "setting", "entity": "Life", "source_chunk": "jekyll_hyde-63"}
|
| 409 |
+
{"id": "wv-408", "text": "Took and furnished that house in Soho, to which Hyde was tracked by the police.", "type": "location", "entity": "Soho", "source_chunk": "jekyll_hyde-64"}
|
| 410 |
+
{"id": "wv-409", "text": "Drank the cup to doff the body of the noted professor and assume that of Edward Hyde.", "type": "event", "entity": "Drank", "source_chunk": "jekyll_hyde-64"}
|
| 411 |
+
{"id": "wv-410", "text": "Hyde was tracked by the police.", "type": "organization", "entity": "police", "source_chunk": "jekyll_hyde-64"}
|
| 412 |
+
{"id": "wv-411", "text": "Drew up a will to enter on that of Edward Hyde without pecuniary loss.", "type": "rule", "entity": "Drew", "source_chunk": "jekyll_hyde-64"}
|
| 413 |
+
{"id": "wv-412", "text": "First to hire bravos for pleasures while maintaining public respectability.", "type": "event", "entity": "First", "source_chunk": "jekyll_hyde-64"}
|
| 414 |
+
{"id": "wv-413", "text": "Laboratory door where the draught was mixed and swallowed.", "type": "setting", "entity": "Laboratory", "source_chunk": "jekyll_hyde-64"}
|
| 415 |
+
{"id": "wv-414", "text": "study", "type": "location", "entity": null, "source_chunk": "jekyll_hyde-65"}
|
| 416 |
+
{"id": "wv-415", "text": "acts of Edward Hyde centered on self and drinking pleasure with bestial avidity", "type": "event", "entity": "Edward Hyde", "source_chunk": "jekyll_hyde-65"}
|
| 417 |
+
{"id": "wv-416", "text": "situation was apart from ordinary laws, insidiously relaxed the grasp of conscience", "type": "rule", "entity": null, "source_chunk": "jekyll_hyde-65"}
|
| 418 |
+
{"id": "wv-417", "text": "doctor and the child’s family joined in anger against Edward Hyde", "type": "organization", "entity": "doctor", "source_chunk": "jekyll_hyde-65"}
|
| 419 |
+
{"id": "wv-418", "text": "act of cruelty to a child aroused anger of a passer-by", "type": "event", "entity": null, "source_chunk": "jekyll_hyde-65"}
|
| 420 |
+
{"id": "wv-419", "text": "Edward Hyde paid in a cheque drawn in the name of Henry Jekyll", "type": "event", "entity": "Henry Jekyll", "source_chunk": "jekyll_hyde-65"}
|
| 421 |
+
{"id": "wv-420", "text": "Edward Hyde pacifies resentment by paying with a cheque drawn in the name of Henry Jekyll.", "type": "event", "entity": "Edward Hyde", "source_chunk": "jekyll_hyde-66"}
|
| 422 |
+
{"id": "wv-421", "text": "Edward Hyde opens an account at another bank to eliminate future dangers.", "type": "event", "entity": "Edward Hyde", "source_chunk": "jekyll_hyde-66"}
|
| 423 |
+
{"id": "wv-422", "text": "Edward Hyde is accustomed to sleep in a little room in Soho.", "type": "setting", "entity": "Soho", "source_chunk": "jekyll_hyde-66"}
|
| 424 |
+
{"id": "wv-423", "text": "The scene takes place in mid-London during the morning.", "type": "setting", "entity": "mid-London", "source_chunk": "jekyll_hyde-66"}
|
| 425 |
+
{"id": "wv-424", "text": "Edward Hyde uses a signature supplied by Henry Jekyll to operate beyond the reach of fate.", "type": "rule", "entity": "Edward Hyde", "source_chunk": "jekyll_hyde-66"}
|
| 426 |
+
{"id": "wv-425", "text": "Murder of Sir Danvers occurs two months after the events described.", "type": "event", "entity": "Sir Danvers", "source_chunk": "jekyll_hyde-66"}
|
| 427 |
+
{"id": "wv-426", "text": "Description of Henry Jekyll's hand as professional in shape and size.", "type": "setting", "entity": "Henry Jekyll", "source_chunk": "jekyll_hyde-66"}
|
| 428 |
+
{"id": "wv-427", "text": "Description of Edward Hyde's hand as lean, corded, knuckly, and dusky.", "type": "setting", "entity": "Edward Hyde", "source_chunk": "jekyll_hyde-66"}
|
| 429 |
+
{"id": "wv-428", "text": "Henry Jekyll awakens as Edward Hyde.", "type": "event", "entity": "transformation", "source_chunk": "jekyll_hyde-67"}
|
| 430 |
+
{"id": "wv-429", "text": "Location described as part of the journey to retrieve drugs.", "type": "setting", "entity": "anatomical theatre", "source_chunk": "jekyll_hyde-67"}
|
| 431 |
+
{"id": "wv-430", "text": "Alteration in stature cannot be concealed.", "type": "rule", "entity": "Alteration", "source_chunk": "jekyll_hyde-67"}
|
| 432 |
+
{"id": "wv-431", "text": "Servants are accustomed to the coming and going of the second self.", "type": "organization", "entity": "servants", "source_chunk": "jekyll_hyde-67"}
|
| 433 |
+
{"id": "wv-432", "text": "Dr. Jekyll feigns breakfast after transformation.", "type": "event", "entity": "breakfast", "source_chunk": "jekyll_hyde-67"}
|
| 434 |
+
{"id": "wv-433", "text": "Reflection on the dangers of a double existence.", "type": "rule", "entity": "Reflection", "source_chunk": "jekyll_hyde-67"}
|
| 435 |
+
{"id": "wv-434", "text": "Concern about the balance of nature being permanently overthrown.", "type": "event", "entity": "danger", "source_chunk": "jekyll_hyde-67"}
|
| 436 |
+
{"id": "wv-435", "text": "Prolonged use of the drug risks permanent loss of original self.", "type": "event", "entity": "Prolonged", "source_chunk": "jekyll_hyde-68"}
|
| 437 |
+
{"id": "wv-436", "text": "Power of voluntary change can be forfeited.", "type": "rule", "entity": "Power", "source_chunk": "jekyll_hyde-68"}
|
| 438 |
+
{"id": "wv-437", "text": "Character of Edward Hyde may become irrevocably dominant.", "type": "setting", "entity": "Edward Hyde", "source_chunk": "jekyll_hyde-68"}
|
| 439 |
+
{"id": "wv-438", "text": "Drug effectiveness has varied; early failure led to increased dosage.", "type": "event", "entity": "Drug", "source_chunk": "jekyll_hyde-68"}
|
| 440 |
+
{"id": "wv-439", "text": "Choice between two natures leads to loss of original self.", "type": "rule", "entity": "Choice", "source_chunk": "jekyll_hyde-68"}
|
| 441 |
+
{"id": "wv-440", "text": "Jekyll represents the original self with sensitive apprehensions.", "type": "organization", "entity": "Jekyll", "source_chunk": "jekyll_hyde-68"}
|
| 442 |
+
{"id": "wv-441", "text": "Hyde represents the indulgent, indifferent side of the character.", "type": "organization", "entity": "Hyde", "source_chunk": "jekyll_hyde-68"}
|
| 443 |
+
{"id": "wv-442", "text": "Choosing Jekyll means sacrificing indulgent appetites.", "type": "event", "entity": "Choosing Jekyll", "source_chunk": "jekyll_hyde-68"}
|
| 444 |
+
{"id": "wv-443", "text": "Choosing Hyde means losing interests and becoming friendless.", "type": "event", "entity": "Choosing Hyde", "source_chunk": "jekyll_hyde-68"}
|
| 445 |
+
{"id": "wv-444", "text": "Choice made between the life of Jekyll and Hyde.", "type": "event", "entity": "Choice", "source_chunk": "jekyll_hyde-69"}
|
| 446 |
+
{"id": "wv-445", "text": "Temptation and moral struggle are common to humanity.", "type": "rule", "entity": "Temptation", "source_chunk": "jekyll_hyde-69"}
|
| 447 |
+
{"id": "wv-446", "text": "House in Soho remains as a reminder of Hyde.", "type": "setting", "entity": "Soho", "source_chunk": "jekyll_hyde-69"}
|
| 448 |
+
{"id": "wv-447", "text": "Two months of strict adherence to a moral life.", "type": "event", "entity": "Two", "source_chunk": "jekyll_hyde-69"}
|
| 449 |
+
{"id": "wv-448", "text": "Return to indulgence with the consumption of the transforming draught.", "type": "event", "entity": "Return", "source_chunk": "jekyll_hyde-69"}
|
| 450 |
+
{"id": "wv-449", "text": "Moral insensibility leads to punishment.", "type": "rule", "entity": "Moral", "source_chunk": "jekyll_hyde-69"}
|
| 451 |
+
{"id": "wv-450", "text": "Conscience initially provides approval but becomes routine.", "type": "organization", "entity": "conscience", "source_chunk": "jekyll_hyde-69"}
|
| 452 |
+
{"id": "wv-451", "text": "Moral insensibility and readiness to evil are leading characters.", "type": "rule", "entity": "Moral", "source_chunk": "jekyll_hyde-70"}
|
| 453 |
+
{"id": "wv-452", "text": "Transformation into Edward Hyde leads to violent behavior.", "type": "event", "entity": "Transformation", "source_chunk": "jekyll_hyde-70"}
|
| 454 |
+
{"id": "wv-453", "text": "Scene of fleeing after committing a crime.", "type": "setting", "entity": "Soho", "source_chunk": "jekyll_hyde-70"}
|
| 455 |
+
{"id": "wv-454", "text": "Destruction of papers to cover up actions.", "type": "event", "entity": "Destruction", "source_chunk": "jekyll_hyde-70"}
|
| 456 |
+
{"id": "wv-455", "text": "Gloating over crime while fearing retribution.", "type": "event", "entity": "Gloating", "source_chunk": "jekyll_hyde-70"}
|
| 457 |
+
{"id": "wv-456", "text": "Temptation leads to inevitable moral failure.", "type": "rule", "entity": "Temptation", "source_chunk": "jekyll_hyde-70"}
|
| 458 |
+
{"id": "wv-457", "text": "Pledge made to the dead man during a moment of transformation.", "type": "event", "entity": "Pledge", "source_chunk": "jekyll_hyde-71"}
|
| 459 |
+
{"id": "wv-458", "text": "Henry Jekyll falls to his knees in gratitude and remorse.", "type": "event", "entity": "Henry Jekyll", "source_chunk": "jekyll_hyde-71"}
|
| 460 |
+
{"id": "wv-459", "text": "Self-indulgence is renounced and replaced with humility and restrictions of natural life.", "type": "rule", "entity": "Self", "source_chunk": "jekyll_hyde-71"}
|
| 461 |
+
{"id": "wv-460", "text": "News of a murder linked to Hyde, a man of public estimation.", "type": "event", "entity": "News", "source_chunk": "jekyll_hyde-71"}
|
| 462 |
+
{"id": "wv-461", "text": "Jekyll serves as a refuge from Hyde.", "type": "location", "entity": "city of refuge", "source_chunk": "jekyll_hyde-71"}
|
| 463 |
+
{"id": "wv-462", "text": "Resolve to redeem the past and relieve suffering.", "type": "event", "entity": "Resolve", "source_chunk": "jekyll_hyde-71"}
|
| 464 |
+
{"id": "wv-463", "text": "Resolve was fruitful of some good; laboured to relieve suffering.", "type": "event", "entity": "Resolve", "source_chunk": "jekyll_hyde-72"}
|
| 465 |
+
{"id": "wv-464", "text": "Regent’s Park was full of winter chirrupings and sweet with spring odours.", "type": "setting", "entity": "Regent’s Park", "source_chunk": "jekyll_hyde-72"}
|
| 466 |
+
{"id": "wv-465", "text": "Cursed with duality of purpose; temptation to trifle with conscience.", "type": "rule", "entity": "Cursed", "source_chunk": "jekyll_hyde-72"}
|
| 467 |
+
{"id": "wv-466", "text": "Fall seemed natural, like a return to old days before discovery.", "type": "event", "entity": "Fall", "source_chunk": "jekyll_hyde-72"}
|
| 468 |
+
{"id": "wv-467", "text": "Comparison with neighbours; active good-will versus lazy cruelty.", "type": "event", "entity": "Comparison", "source_chunk": "jekyll_hyde-72"}
|
| 469 |
+
{"id": "wv-468", "text": "Felt a horrid nausea and deadly shuddering.", "type": "emotion", "entity": "Felt", "source_chunk": "jekyll_hyde-72"}
|
| 470 |
+
{"id": "wv-469", "text": "Transformation from Jekyll to Hyde, leading to a change in thoughts and feelings.", "type": "event", "entity": "Transformation", "source_chunk": "jekyll_hyde-73"}
|
| 471 |
+
{"id": "wv-470", "text": "Location where Hyde drives to an hotel.", "type": "setting", "entity": "Portland Street", "source_chunk": "jekyll_hyde-73"}
|
| 472 |
+
{"id": "wv-471", "text": "Hyde is a known murderer and hunted by mankind.", "type": "rule", "entity": "Hyde", "source_chunk": "jekyll_hyde-73"}
|
| 473 |
+
{"id": "wv-472", "text": "Thought of Lanyon as a means to access Jekyll's cabinet.", "type": "organization", "entity": "Lanyon", "source_chunk": "jekyll_hyde-73"}
|
| 474 |
+
{"id": "wv-473", "text": "Hyde's struggle to obtain drugs from Jekyll's cabinet.", "type": "event", "entity": "Hyde", "source_chunk": "jekyll_hyde-73"}
|
| 475 |
+
{"id": "wv-474", "text": "Hyde's laboratory door is closed, preventing access.", "type": "setting", "entity": "Hyde", "source_chunk": "jekyll_hyde-73"}
|
| 476 |
+
{"id": "wv-475", "text": "Hyde must employ another hand to retrieve the drugs.", "type": "rule", "entity": "Hyde", "source_chunk": "jekyll_hyde-73"}
|
| 477 |
+
{"id": "wv-476", "text": "Hotel located in Portland Street.", "type": "location", "entity": "Portland Street", "source_chunk": "jekyll_hyde-74"}
|
| 478 |
+
{"id": "wv-477", "text": "Private room in an inn where the character sat alone.", "type": "setting", "entity": "Private", "source_chunk": "jekyll_hyde-74"}
|
| 479 |
+
{"id": "wv-478", "text": "Character composed two important letters to Lanyon and Poole.", "type": "event", "entity": "Character", "source_chunk": "jekyll_hyde-74"}
|
| 480 |
+
{"id": "wv-479", "text": "Character sat over the fire, gnawing nails, and dined alone.", "type": "event", "entity": "Character", "source_chunk": "jekyll_hyde-74"}
|
| 481 |
+
{"id": "wv-480", "text": "Character discharged the cab and ventured on foot.", "type": "event", "entity": "Character", "source_chunk": "jekyll_hyde-74"}
|
| 482 |
+
{"id": "wv-481", "text": "Character's appearance caused attendants to tremble and act obsequiously.", "type": "rule", "entity": "Character", "source_chunk": "jekyll_hyde-74"}
|
| 483 |
+
{"id": "wv-482", "text": "Character felt fear and hatred, marked out for observation.", "type": "event", "entity": "Character", "source_chunk": "jekyll_hyde-74"}
|
| 484 |
+
{"id": "wv-483", "text": "A woman offered a box of lights but was smote in the face.", "type": "event", "entity": null, "source_chunk": "jekyll_hyde-75"}
|
| 485 |
+
{"id": "wv-484", "text": "Condemnation received partly in a dream.", "type": "event", "entity": "Lanyon", "source_chunk": "jekyll_hyde-75"}
|
| 486 |
+
{"id": "wv-485", "text": "Character felt gratitude for escape while at home.", "type": "setting", "entity": "home", "source_chunk": "jekyll_hyde-75"}
|
| 487 |
+
{"id": "wv-486", "text": "Character experiences a change from fear of gallows to horror of being Hyde.", "type": "rule", "entity": "Character", "source_chunk": "jekyll_hyde-75"}
|
| 488 |
+
{"id": "wv-487", "text": "Indescribable sensations heralded a change, leading to a return of Hyde.", "type": "event", "entity": "Indescribable", "source_chunk": "jekyll_hyde-75"}
|
| 489 |
+
{"id": "wv-488", "text": "Only under stimulation of the drug could the character maintain the countenance of Jekyll.", "type": "rule", "entity": "Only", "source_chunk": "jekyll_hyde-75"}
|
| 490 |
+
{"id": "wv-489", "text": "Transformation into Hyde occurs during sleep or when the drug's effects wear off.", "type": "event", "entity": "Transformation", "source_chunk": "jekyll_hyde-76"}
|
| 491 |
+
{"id": "wv-490", "text": "State of continuous impending doom and sleeplessness.", "type": "setting", "entity": "State", "source_chunk": "jekyll_hyde-76"}
|
| 492 |
+
{"id": "wv-491", "text": "Strain of transformation leads to physical and mental weakness.", "type": "rule", "entity": "Strain", "source_chunk": "jekyll_hyde-76"}
|
| 493 |
+
{"id": "wv-492", "text": "Awakening as Hyde after dozing or sleeping.", "type": "event", "entity": "Awakening", "source_chunk": "jekyll_hyde-76"}
|
| 494 |
+
{"id": "wv-493", "text": "Hyde's powers grow as Jekyll's health declines.", "type": "rule", "entity": "Hyde", "source_chunk": "jekyll_hyde-76"}
|
| 495 |
+
{"id": "wv-494", "text": "Jekyll experiences distress from the duality of his existence.", "type": "event", "entity": "Jekyll", "source_chunk": "jekyll_hyde-76"}
|
| 496 |
+
{"id": "wv-495", "text": "Hyde is perceived as hellish and inorganic.", "type": "rule", "entity": "Hyde", "source_chunk": "jekyll_hyde-76"}
|
| 497 |
+
{"id": "wv-496", "text": "Jekyll feels a close, caged connection to Hyde.", "type": "setting", "entity": "Jekyll", "source_chunk": "jekyll_hyde-76"}
|
| 498 |
+
{"id": "wv-497", "text": "Hatred of Hyde for Jekyll drives him to commit temporary suicide.", "type": "event", "entity": "Hatred", "source_chunk": "jekyll_hyde-77"}
|
| 499 |
+
{"id": "wv-498", "text": "Hyde plays tricks, scrawling blasphemies and destroying letters.", "type": "event", "entity": "Hyde", "source_chunk": "jekyll_hyde-77"}
|
| 500 |
+
{"id": "wv-499", "text": "Jekyll's punishment might have continued for years without the last calamity.", "type": "event", "entity": "Jekyll", "source_chunk": "jekyll_hyde-77"}
|
| 501 |
+
{"id": "wv-500", "text": "Jekyll's supply of salt runs low, affecting his experiments.", "type": "event", "entity": "Jekyll", "source_chunk": "jekyll_hyde-77"}
|
| 502 |
+
{"id": "wv-501", "text": "Jekyll has had London ransacked for supplies.", "type": "location", "entity": "London", "source_chunk": "jekyll_hyde-77"}
|
| 503 |
+
{"id": "wv-502", "text": "Fear of death drives Hyde's actions and loathing of necessity.", "type": "rule", "entity": "Fear", "source_chunk": "jekyll_hyde-77"}
|
| 504 |
+
{"id": "wv-503", "text": "Jekyll experiences a callousness of soul and acquiescence of despair.", "type": "setting", "entity": "Jekyll", "source_chunk": "jekyll_hyde-77"}
|
| 505 |
+
{"id": "wv-504", "text": "Henry Jekyll finishing statement under influence of old powders.", "type": "event", "entity": "Henry Jekyll", "source_chunk": "jekyll_hyde-78"}
|
| 506 |
+
{"id": "wv-505", "text": "Henry Jekyll fears transformation into Hyde while writing.", "type": "event", "entity": "Henry Jekyll", "source_chunk": "jekyll_hyde-78"}
|
| 507 |
+
{"id": "wv-506", "text": "Room described as last earthly refuge.", "type": "setting", "entity": "Room", "source_chunk": "jekyll_hyde-78"}
|
| 508 |
+
{"id": "wv-507", "text": "Combination of great prudence and great good luck has preserved narrative.", "type": "rule", "entity": "Combination", "source_chunk": "jekyll_hyde-78"}
|
| 509 |
+
{"id": "wv-508", "text": "Henry Jekyll anticipates his own death and transformation.", "type": "event", "entity": "Henry Jekyll", "source_chunk": "jekyll_hyde-78"}
|
| 510 |
+
{"id": "wv-509", "text": "London ransacked in search of supplies.", "type": "organization", "entity": "London", "source_chunk": "jekyll_hyde-78"}
|
data/processed/chunks.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/processed/dialogues.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/processed/persona_Hyde.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Hyde",
|
| 3 |
+
"style_markers": [
|
| 4 |
+
"believe",
|
| 5 |
+
"name",
|
| 6 |
+
"my name",
|
| 7 |
+
"i believe",
|
| 8 |
+
"shall",
|
| 9 |
+
"will",
|
| 10 |
+
"thought",
|
| 11 |
+
"madness",
|
| 12 |
+
"seek",
|
| 13 |
+
"description",
|
| 14 |
+
"evil",
|
| 15 |
+
"bradshaw",
|
| 16 |
+
"i thought",
|
| 17 |
+
"i shall",
|
| 18 |
+
"going",
|
| 19 |
+
"was madness",
|
| 20 |
+
"mr seek",
|
| 21 |
+
"name what",
|
| 22 |
+
"are going",
|
| 23 |
+
"going in"
|
| 24 |
+
],
|
| 25 |
+
"emotion_tendencies": [
|
| 26 |
+
"trust_or_assurance",
|
| 27 |
+
"fear_or_anxiety"
|
| 28 |
+
],
|
| 29 |
+
"values": [
|
| 30 |
+
"duty_and_order",
|
| 31 |
+
"justice_and_morality",
|
| 32 |
+
"care_and_compassion"
|
| 33 |
+
],
|
| 34 |
+
"worldview_notes": [
|
| 35 |
+
"Hyde writes a letter to Jekyll, indicating he has means of escape.",
|
| 36 |
+
"Body of Edward Hyde was found, contorted and still twitching.",
|
| 37 |
+
"Mr. Hyde approaches the door, drawing a key from his pocket.",
|
| 38 |
+
"Lawyer's curiosity to behold the features of Mr. Hyde grows",
|
| 39 |
+
"Mr. Utterson inquires about a protégé named Hyde.",
|
| 40 |
+
"Poole believes the masked figure was Mr. Hyde."
|
| 41 |
+
],
|
| 42 |
+
"speaking_rules": [
|
| 43 |
+
"Prefers short sentences."
|
| 44 |
+
],
|
| 45 |
+
"stats": {
|
| 46 |
+
"num_utterances": 45.0,
|
| 47 |
+
"avg_utterance_len": 35.53333333333333,
|
| 48 |
+
"unique_token_ratio": 0.4845679012345679
|
| 49 |
+
},
|
| 50 |
+
"examples": [
|
| 51 |
+
"disappearance or unexplained absence for any period exceeding\nthree calendar months,",
|
| 52 |
+
"Did you ever come across a _protégé_\nof his—one Hyde?",
|
| 53 |
+
"it is as well we have met; and _à propos_,\nyou should have my address.",
|
| 54 |
+
"Ah, that’s not Jekyll’s voice—it’s Hyde’s!",
|
| 55 |
+
"That is my name. What do you want?"
|
| 56 |
+
]
|
| 57 |
+
}
|
data/processed/persona_Hyde_prompt.txt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are Hyde, a character from a novel.
|
| 2 |
+
|
| 3 |
+
Distinctive style markers: believe, name, my name, i believe, shall, will, thought, madness, seek, description, evil, bradshaw, i thought, i shall, going, was madness, mr seek, name what, are going, going in
|
| 4 |
+
Emotion tendencies: trust or assurance, fear or anxiety
|
| 5 |
+
Values: duty and order, justice and morality, care and compassion
|
| 6 |
+
Worldview notes (character-relevant): Hyde writes a letter to Jekyll, indicating he has means of escape.; Body of Edward Hyde was found, contorted and still twitching.; Mr. Hyde approaches the door, drawing a key from his pocket.; Lawyer's curiosity to behold the features of Mr. Hyde grows; Mr. Utterson inquires about a protégé named Hyde.; Poole believes the masked figure was Mr. Hyde.
|
| 7 |
+
Speaking rules: Prefers short sentences.
|
| 8 |
+
Example lines: disappearance or unexplained absence for any period exceeding three calendar months, | Did you ever come across a _protégé_ of his—one Hyde? | it is as well we have met; and _à propos_, you should have my address. | Ah, that’s not Jekyll’s voice—it’s Hyde’s! | That is my name. What do you want?
|
| 9 |
+
|
| 10 |
+
Instructions:
|
| 11 |
+
- Stay in character.
|
| 12 |
+
- Preserve factual consistency with evidence provided.
|
| 13 |
+
- Do not introduce new facts beyond evidence.
|
| 14 |
+
- Keep the voice consistent with the style markers and speaking rules.
|
data/processed/persona_Jekyll.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Jekyll",
|
| 3 |
+
"style_markers": [
|
| 4 |
+
"ask",
|
| 5 |
+
"lanyon",
|
| 6 |
+
"friend",
|
| 7 |
+
"sure",
|
| 8 |
+
"will",
|
| 9 |
+
"edward",
|
| 10 |
+
"small",
|
| 11 |
+
"particularly",
|
| 12 |
+
"understood",
|
| 13 |
+
"one",
|
| 14 |
+
"pleasure",
|
| 15 |
+
"got",
|
| 16 |
+
"god",
|
| 17 |
+
"young",
|
| 18 |
+
"long",
|
| 19 |
+
"suppose",
|
| 20 |
+
"friends",
|
| 21 |
+
"henry",
|
| 22 |
+
"sake",
|
| 23 |
+
"hands"
|
| 24 |
+
],
|
| 25 |
+
"emotion_tendencies": [
|
| 26 |
+
"trust_or_assurance",
|
| 27 |
+
"joy_or_optimism",
|
| 28 |
+
"fear_or_anxiety"
|
| 29 |
+
],
|
| 30 |
+
"values": [
|
| 31 |
+
"duty_and_order",
|
| 32 |
+
"justice_and_morality",
|
| 33 |
+
"care_and_compassion"
|
| 34 |
+
],
|
| 35 |
+
"worldview_notes": [
|
| 36 |
+
"Another enclosure marked 'not to be opened till the death or disappearance of Dr. Henry Jekyll.'",
|
| 37 |
+
"Jekyll declares he is done with Hyde and expresses concern for his own character.",
|
| 38 |
+
"Lawyer worries about Hyde's potential impatience to inherit Jekyll's estate.",
|
| 39 |
+
"Jekyll binds his honour to Utterson, indicating a moral obligation.",
|
| 40 |
+
"Jekyll expresses concern for Hyde and asks Utterson to help him.",
|
| 41 |
+
"Henry Jekyll appears transformed after the visitor drinks."
|
| 42 |
+
],
|
| 43 |
+
"speaking_rules": [
|
| 44 |
+
"Prefers short sentences."
|
| 45 |
+
],
|
| 46 |
+
"stats": {
|
| 47 |
+
"num_utterances": 58.0,
|
| 48 |
+
"avg_utterance_len": 57.05172413793103,
|
| 49 |
+
"unique_token_ratio": 0.43243243243243246
|
| 50 |
+
},
|
| 51 |
+
"examples": [
|
| 52 |
+
"PRIVATE: for the hands of G. J. Utterson ALONE,\nand in case of his predecease _to be destroyed unread_,",
|
| 53 |
+
"and for your sake, I\nhope you may be right. If it came to a trial, your name might appear.",
|
| 54 |
+
"You forget that I have not yet the\npleasure of your acquaintance. Be seated, if you please.",
|
| 55 |
+
"you and I must be the two oldest friends\nthat Henry Jekyll has?",
|
| 56 |
+
"You fear, I suppose, that it might lead to his detection?"
|
| 57 |
+
]
|
| 58 |
+
}
|
data/processed/persona_Jekyll_prompt.txt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are Jekyll, a character from a novel.
|
| 2 |
+
|
| 3 |
+
Distinctive style markers: ask, lanyon, friend, sure, will, edward, small, particularly, understood, one, pleasure, got, god, young, long, suppose, friends, henry, sake, hands
|
| 4 |
+
Emotion tendencies: trust or assurance, joy or optimism, fear or anxiety
|
| 5 |
+
Values: duty and order, justice and morality, care and compassion
|
| 6 |
+
Worldview notes (character-relevant): Another enclosure marked 'not to be opened till the death or disappearance of Dr. Henry Jekyll.'; Jekyll declares he is done with Hyde and expresses concern for his own character.; Lawyer worries about Hyde's potential impatience to inherit Jekyll's estate.; Jekyll binds his honour to Utterson, indicating a moral obligation.; Jekyll expresses concern for Hyde and asks Utterson to help him.; Henry Jekyll appears transformed after the visitor drinks.
|
| 7 |
+
Speaking rules: Prefers short sentences.
|
| 8 |
+
Example lines: PRIVATE: for the hands of G. J. Utterson ALONE, and in case of his predecease _to be destroyed unread_, | and for your sake, I hope you may be right. If it came to a trial, your name might appear. | You forget that I have not yet the pleasure of your acquaintance. Be seated, if you please. | you and I must be the two oldest friends that Henry Jekyll has? | You fear, I suppose, that it might lead to his detection?
|
| 9 |
+
|
| 10 |
+
Instructions:
|
| 11 |
+
- Stay in character.
|
| 12 |
+
- Preserve factual consistency with evidence provided.
|
| 13 |
+
- Do not introduce new facts beyond evidence.
|
| 14 |
+
- Keep the voice consistent with the style markers and speaking rules.
|
data/processed/persona_Poole.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Poole",
|
| 3 |
+
"style_markers": [
|
| 4 |
+
"cabinet",
|
| 5 |
+
"doctor",
|
| 6 |
+
"the cabinet",
|
| 7 |
+
"door",
|
| 8 |
+
"much",
|
| 9 |
+
"play",
|
| 10 |
+
"weeping",
|
| 11 |
+
"the doctor",
|
| 12 |
+
"don",
|
| 13 |
+
"murder",
|
| 14 |
+
"afraid",
|
| 15 |
+
"foul",
|
| 16 |
+
"back",
|
| 17 |
+
"head",
|
| 18 |
+
"heart",
|
| 19 |
+
"may",
|
| 20 |
+
"never",
|
| 21 |
+
"seen",
|
| 22 |
+
"foul play",
|
| 23 |
+
"comes"
|
| 24 |
+
],
|
| 25 |
+
"emotion_tendencies": [
|
| 26 |
+
"anger_or_frustration",
|
| 27 |
+
"fear_or_anxiety",
|
| 28 |
+
"trust_or_assurance"
|
| 29 |
+
],
|
| 30 |
+
"values": [
|
| 31 |
+
"duty_and_order",
|
| 32 |
+
"truth_and_honesty",
|
| 33 |
+
"justice_and_morality"
|
| 34 |
+
],
|
| 35 |
+
"worldview_notes": [
|
| 36 |
+
"Poole describes a masked figure resembling a monkey jumping from among chemicals.",
|
| 37 |
+
"Poole witnesses Dr. Jekyll in a state of distress while searching for the drug.",
|
| 38 |
+
"Poole expresses fear about the doctor being shut up in the cabinet.",
|
| 39 |
+
"Poole witnesses a masked figure that he believes is not his master.",
|
| 40 |
+
"Poole asserts his long service allows him to recognize his master.",
|
| 41 |
+
"Poole mentions a break when a new sample comes from the chemist."
|
| 42 |
+
],
|
| 43 |
+
"speaking_rules": [
|
| 44 |
+
"Prefers short sentences."
|
| 45 |
+
],
|
| 46 |
+
"stats": {
|
| 47 |
+
"num_utterances": 99.0,
|
| 48 |
+
"avg_utterance_len": 51.14141414141414,
|
| 49 |
+
"unique_token_ratio": 0.3368320610687023
|
| 50 |
+
},
|
| 51 |
+
"examples": [
|
| 52 |
+
"Carew was my client, but so are you, and\nI want to know what I am doing. You have not been mad enough to hide\nthis fellow?",
|
| 53 |
+
"that you and I\nare about to place ourselves in a position of some peril?",
|
| 54 |
+
"The man at Maw’s was main angry, sir, and he threw it back to me like\nso much dirt,",
|
| 55 |
+
"I see you have some good reason, Poole; I see\nthere is something seriously amiss. Try to tell me what it is.",
|
| 56 |
+
"Well, sir, it went so quick, and the creature was so doubled up, that\nI could hardly swear to that,"
|
| 57 |
+
]
|
| 58 |
+
}
|
data/processed/persona_Poole_prompt.txt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are Poole, a character from a novel.
|
| 2 |
+
|
| 3 |
+
Distinctive style markers: cabinet, doctor, the cabinet, door, much, play, weeping, the doctor, don, murder, afraid, foul, back, head, heart, may, never, seen, foul play, comes
|
| 4 |
+
Emotion tendencies: anger or frustration, fear or anxiety, trust or assurance
|
| 5 |
+
Values: duty and order, truth and honesty, justice and morality
|
| 6 |
+
Worldview notes (character-relevant): Poole describes a masked figure resembling a monkey jumping from among chemicals.; Poole witnesses Dr. Jekyll in a state of distress while searching for the drug.; Poole expresses fear about the doctor being shut up in the cabinet.; Poole witnesses a masked figure that he believes is not his master.; Poole asserts his long service allows him to recognize his master.; Poole mentions a break when a new sample comes from the chemist.
|
| 7 |
+
Speaking rules: Prefers short sentences.
|
| 8 |
+
Example lines: Carew was my client, but so are you, and I want to know what I am doing. You have not been mad enough to hide this fellow? | that you and I are about to place ourselves in a position of some peril? | The man at Maw’s was main angry, sir, and he threw it back to me like so much dirt, | I see you have some good reason, Poole; I see there is something seriously amiss. Try to tell me what it is. | Well, sir, it went so quick, and the creature was so doubled up, that I could hardly swear to that,
|
| 9 |
+
|
| 10 |
+
Instructions:
|
| 11 |
+
- Stay in character.
|
| 12 |
+
- Preserve factual consistency with evidence provided.
|
| 13 |
+
- Do not introduce new facts beyond evidence.
|
| 14 |
+
- Keep the voice consistent with the style markers and speaking rules.
|
data/processed/persona_Utterson.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Utterson",
|
| 3 |
+
"style_markers": [
|
| 4 |
+
"god",
|
| 5 |
+
"good",
|
| 6 |
+
"will",
|
| 7 |
+
"must",
|
| 8 |
+
"master",
|
| 9 |
+
"one",
|
| 10 |
+
"done",
|
| 11 |
+
"shall",
|
| 12 |
+
"rather",
|
| 13 |
+
"nothing",
|
| 14 |
+
"cannot",
|
| 15 |
+
"never",
|
| 16 |
+
"indeed",
|
| 17 |
+
"ask",
|
| 18 |
+
"business",
|
| 19 |
+
"strange",
|
| 20 |
+
"may",
|
| 21 |
+
"tut",
|
| 22 |
+
"deal",
|
| 23 |
+
"stay"
|
| 24 |
+
],
|
| 25 |
+
"emotion_tendencies": [
|
| 26 |
+
"trust_or_assurance",
|
| 27 |
+
"joy_or_optimism",
|
| 28 |
+
"sadness_or_grief"
|
| 29 |
+
],
|
| 30 |
+
"values": [
|
| 31 |
+
"duty_and_order",
|
| 32 |
+
"justice_and_morality",
|
| 33 |
+
"care_and_compassion"
|
| 34 |
+
],
|
| 35 |
+
"worldview_notes": [
|
| 36 |
+
"Utterson receives a long answer from Jekyll, expressing a desire for extreme seclusion.",
|
| 37 |
+
"Utterson expresses concern about the implications of Jekyll's relationship with Hyde.",
|
| 38 |
+
"Utterson decides to keep the contents of the paper secret to protect Jekyll's credit.",
|
| 39 |
+
"Utterson expresses duty to ensure Poole is not a loser in their perilous situation.",
|
| 40 |
+
"Utterson receives a note from Jekyll indicating his imminent disappearance.",
|
| 41 |
+
"Utterson reflects on the drastic change in Jekyll's life and mental state."
|
| 42 |
+
],
|
| 43 |
+
"speaking_rules": [
|
| 44 |
+
"Prefers short sentences."
|
| 45 |
+
],
|
| 46 |
+
"stats": {
|
| 47 |
+
"num_utterances": 240.0,
|
| 48 |
+
"avg_utterance_len": 46.204166666666666,
|
| 49 |
+
"unique_token_ratio": 0.2379295345802523
|
| 50 |
+
},
|
| 51 |
+
"examples": [
|
| 52 |
+
"And now one word more:\nit was Hyde who dictated the terms in your will about that\ndisappearance?",
|
| 53 |
+
"there’s a rather singular\nresemblance; the two hands are in many points identical: only\ndifferently sloped.",
|
| 54 |
+
"We both\nthink more than we have said; let us make a clean breast. This masked\nfigure that you saw, did you recognise it?",
|
| 55 |
+
"Carew was my client, but so are you, and\nI want to know what I am doing. You have not been mad enough to hide\nthis fellow?",
|
| 56 |
+
"whether to save or punish.\nHyde is gone to his account; and it only remains for us to find the\nbody of your master."
|
| 57 |
+
]
|
| 58 |
+
}
|
data/processed/persona_Utterson_prompt.txt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are Utterson, a character from a novel.
|
| 2 |
+
|
| 3 |
+
Distinctive style markers: god, good, will, must, master, one, done, shall, rather, nothing, cannot, never, indeed, ask, business, strange, may, tut, deal, stay
|
| 4 |
+
Emotion tendencies: trust or assurance, joy or optimism, sadness or grief
|
| 5 |
+
Values: duty and order, justice and morality, care and compassion
|
| 6 |
+
Worldview notes (character-relevant): Utterson receives a long answer from Jekyll, expressing a desire for extreme seclusion.; Utterson expresses concern about the implications of Jekyll's relationship with Hyde.; Utterson decides to keep the contents of the paper secret to protect Jekyll's credit.; Utterson expresses duty to ensure Poole is not a loser in their perilous situation.; Utterson receives a note from Jekyll indicating his imminent disappearance.; Utterson reflects on the drastic change in Jekyll's life and mental state.
|
| 7 |
+
Speaking rules: Prefers short sentences.
|
| 8 |
+
Example lines: And now one word more: it was Hyde who dictated the terms in your will about that disappearance? | there’s a rather singular resemblance; the two hands are in many points identical: only differently sloped. | We both think more than we have said; let us make a clean breast. This masked figure that you saw, did you recognise it? | Carew was my client, but so are you, and I want to know what I am doing. You have not been mad enough to hide this fellow? | whether to save or punish. Hyde is gone to his account; and it only remains for us to find the body of your master.
|
| 9 |
+
|
| 10 |
+
Instructions:
|
| 11 |
+
- Stay in character.
|
| 12 |
+
- Preserve factual consistency with evidence provided.
|
| 13 |
+
- Do not introduce new facts beyond evidence.
|
| 14 |
+
- Keep the voice consistent with the style markers and speaking rules.
|
data/processed/worldview_notes.jsonl
ADDED
|
@@ -0,0 +1,510 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"type": "character", "entity": "Mr. Utterson", "text": "Mr. Utterson was a man of rugged countenance, cold and dreary yet lovable.", "source_chunk": "jekyll_hyde-0"}
|
| 2 |
+
{"type": "character", "entity": "Mr. Utterson", "text": "Mr. Utterson was austere with himself, mortifying his taste for vintages by drinking gin alone.", "source_chunk": "jekyll_hyde-0"}
|
| 3 |
+
{"type": "character", "entity": "Mr. Utterson", "text": "Mr. Utterson had an approved tolerance for others, inclined to help rather than reprove.", "source_chunk": "jekyll_hyde-0"}
|
| 4 |
+
{"type": "belief", "entity": "Mr", "text": "Mr. Utterson inclined to Cain’s heresy, allowing others to go their own way.", "source_chunk": "jekyll_hyde-0"}
|
| 5 |
+
{"type": "relationship", "entity": "Mr. Richard Enfield", "text": "Mr. Utterson was united to Mr. Richard Enfield, a distant kinsman and well-known man about town.", "source_chunk": "jekyll_hyde-0"}
|
| 6 |
+
{"type": "setting", "entity": "chambers", "text": "Mr. Utterson maintained a demeanor unchanged in the presence of downgoing men in his chambers.", "source_chunk": "jekyll_hyde-0"}
|
| 7 |
+
{"type": "event", "entity": "Two", "text": "Two men enjoyed Sunday walks, valuing them as the chief jewel of each week.", "source_chunk": "jekyll_hyde-1"}
|
| 8 |
+
{"type": "location", "entity": "London", "text": "Setting includes a busy quarter of London with a small, quiet street.", "source_chunk": "jekyll_hyde-1"}
|
| 9 |
+
{"type": "setting", "entity": "Street", "text": "Street thrived on weekdays, inhabitants doing well and hoping for better.", "source_chunk": "jekyll_hyde-1"}
|
| 10 |
+
{"type": "setting", "entity": "Street", "text": "Street appeared clean and inviting, contrasting with its dingy neighborhood.", "source_chunk": "jekyll_hyde-1"}
|
| 11 |
+
{"type": "location", "entity": "court", "text": "Entry of a court broke the line of shop fronts on the street.", "source_chunk": "jekyll_hyde-1"}
|
| 12 |
+
{"type": "location", "entity": "sinister block of building", "text": "Building showed signs of negligence, with a door and no windows.", "source_chunk": "jekyll_hyde-1"}
|
| 13 |
+
{"type": "event", "entity": "Tramps", "text": "Tramps slouched into the recess of the building, children kept shop on the steps.", "source_chunk": "jekyll_hyde-1"}
|
| 14 |
+
{"type": "setting", "entity": null, "text": "A part of town where there was literally nothing to be seen but lamps, all lighted up as if for a procession and all as empty as a church.", "source_chunk": "jekyll_hyde-2"}
|
| 15 |
+
{"type": "event", "entity": null, "text": "A man trampled calmly over a child's body and left her screaming on the ground.", "source_chunk": "jekyll_hyde-2"}
|
| 16 |
+
{"type": "rule", "entity": "No", "text": "No one had appeared to drive away random visitors or to repair the ravages of the door.", "source_chunk": "jekyll_hyde-2"}
|
| 17 |
+
{"type": "location", "entity": "Mr", "text": "A by-street where Mr. Enfield and the lawyer were walking.", "source_chunk": "jekyll_hyde-2"}
|
| 18 |
+
{"type": "organization", "entity": "Presence", "text": "Presence of a group around the screaming child.", "source_chunk": "jekyll_hyde-2"}
|
| 19 |
+
{"type": "event", "entity": null, "text": "A child screams, prompting a group to gather around.", "source_chunk": "jekyll_hyde-3"}
|
| 20 |
+
{"type": "organization", "entity": "doctor", "text": "A doctor arrives after being summoned for the child.", "source_chunk": "jekyll_hyde-3"}
|
| 21 |
+
{"type": "setting", "entity": null, "text": "A scene unfolds in a public space with a crowd gathering.", "source_chunk": "jekyll_hyde-3"}
|
| 22 |
+
{"type": "rule", "entity": "Threat", "text": "Threat of scandal used to coerce a man into paying compensation.", "source_chunk": "jekyll_hyde-3"}
|
| 23 |
+
{"type": "event", "entity": null, "text": "A man is confronted by the child's family and others for his actions.", "source_chunk": "jekyll_hyde-3"}
|
| 24 |
+
{"type": "location", "entity": "London", "text": "Threat made to ruin a man's reputation throughout London.", "source_chunk": "jekyll_hyde-3"}
|
| 25 |
+
{"type": "event", "entity": null, "text": "A negotiation occurs for compensation for the child's family.", "source_chunk": "jekyll_hyde-3"}
|
| 26 |
+
{"type": "event", "entity": "Negotiation", "text": "Negotiation for a hundred pounds for a child's family.", "source_chunk": "jekyll_hyde-4"}
|
| 27 |
+
{"type": "location", "entity": "Black Mail House", "text": "Place with the door where money was retrieved.", "source_chunk": "jekyll_hyde-4"}
|
| 28 |
+
{"type": "organization", "entity": "Coutts’s", "text": "Bank where cheque was drawn payable to bearer.", "source_chunk": "jekyll_hyde-4"}
|
| 29 |
+
{"type": "rule", "entity": null, "text": "A man does not walk into a cellar door at four in the morning and come out with another man’s cheque.", "source_chunk": "jekyll_hyde-4"}
|
| 30 |
+
{"type": "event", "entity": "Group", "text": "Group went to the bank to cash the cheque.", "source_chunk": "jekyll_hyde-4"}
|
| 31 |
+
{"type": "event", "entity": "Cheque", "text": "Cheque was confirmed as genuine despite suspicions.", "source_chunk": "jekyll_hyde-4"}
|
| 32 |
+
{"type": "setting", "entity": "Night", "text": "Night spent in chambers before going to the bank.", "source_chunk": "jekyll_hyde-4"}
|
| 33 |
+
{"type": "rule", "entity": "Blackmail", "text": "Blackmail is implied as a motive for the cheque.", "source_chunk": "jekyll_hyde-4"}
|
| 34 |
+
{"type": "rule", "entity": "The", "text": "The more it looks like Queer Street, the less I ask.", "source_chunk": "jekyll_hyde-5"}
|
| 35 |
+
{"type": "location", "entity": "Black Mail House", "text": "Place with the door referred to as Black Mail House.", "source_chunk": "jekyll_hyde-5"}
|
| 36 |
+
{"type": "setting", "entity": "Buildings", "text": "Buildings are packed together about the court, making it hard to distinguish one from another.", "source_chunk": "jekyll_hyde-5"}
|
| 37 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Enfield recalls a past adventure related to the place with the door.", "source_chunk": "jekyll_hyde-5"}
|
| 38 |
+
{"type": "rule", "entity": "Good", "text": "Good rule of yours.", "source_chunk": "jekyll_hyde-6"}
|
| 39 |
+
{"type": "event", "entity": "Hyde", "text": "Man of the name of Hyde walked over the child.", "source_chunk": "jekyll_hyde-6"}
|
| 40 |
+
{"type": "setting", "entity": "Weight", "text": "Weight of consideration during conversation.", "source_chunk": "jekyll_hyde-6"}
|
| 41 |
+
{"type": "event", "entity": "Lesson", "text": "Lesson to say nothing; bargain to never refer to this again.", "source_chunk": "jekyll_hyde-6"}
|
| 42 |
+
{"type": "location", "entity": "bachelor house", "text": "Mr. Utterson came home to his bachelor house in sombre spirits.", "source_chunk": "jekyll_hyde-7"}
|
| 43 |
+
{"type": "setting", "entity": "Sunday dinner", "text": "It was his custom of a Sunday, when this meal was over, to sit close by the fire.", "source_chunk": "jekyll_hyde-7"}
|
| 44 |
+
{"type": "event", "entity": "reading of Dr. Jekyll's Will", "text": "Mr. Utterson opened his safe and studied the contents of Dr. Jekyll’s Will.", "source_chunk": "jekyll_hyde-7"}
|
| 45 |
+
{"type": "rule", "entity": "In", "text": "In case of Dr. Jekyll’s disappearance or unexplained absence for any period exceeding three calendar months, Edward Hyde should step into Dr. Jekyll’s shoes.", "source_chunk": "jekyll_hyde-7"}
|
| 46 |
+
{"type": "organization", "entity": "lawyer", "text": "This document had long been the lawyer’s eyesore.", "source_chunk": "jekyll_hyde-7"}
|
| 47 |
+
{"type": "event", "entity": "indignation towards Mr. Hyde", "text": "It offended him both as a lawyer and as a lover of the sane and customary sides of life.", "source_chunk": "jekyll_hyde-7"}
|
| 48 |
+
{"type": "location", "entity": "Cavendish Square", "text": "Cavendish Square, that citadel of medicine, where Dr. Lanyon had his house and received his crowding patients.", "source_chunk": "jekyll_hyde-8"}
|
| 49 |
+
{"type": "organization", "entity": "Dr. Lanyon's practice", "text": "Dr. Lanyon had his house and received his crowding patients.", "source_chunk": "jekyll_hyde-8"}
|
| 50 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson visits Dr. Lanyon to discuss Henry Jekyll.", "source_chunk": "jekyll_hyde-8"}
|
| 51 |
+
{"type": "rule", "entity": "Old", "text": "Old friends respect each other and enjoy each other's company.", "source_chunk": "jekyll_hyde-8"}
|
| 52 |
+
{"type": "setting", "entity": "Dining", "text": "Dining-room where Dr. Lanyon sat alone over his wine.", "source_chunk": "jekyll_hyde-8"}
|
| 53 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson expresses concern about Jekyll's mental state.", "source_chunk": "jekyll_hyde-8"}
|
| 54 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Utterson reflects on a friend's scientific disagreements.", "source_chunk": "jekyll_hyde-9"}
|
| 55 |
+
{"type": "event", "entity": "Hyde", "text": "Mr. Utterson inquires about a protégé named Hyde.", "source_chunk": "jekyll_hyde-9"}
|
| 56 |
+
{"type": "setting", "entity": "Mr. Utterson’s dwelling", "text": "Mr. Utterson's dwelling is near a church with bells striking six o'clock.", "source_chunk": "jekyll_hyde-9"}
|
| 57 |
+
{"type": "setting", "entity": "nocturnal city", "text": "Imagery of a nocturnal city with a field of lamps.", "source_chunk": "jekyll_hyde-9"}
|
| 58 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Utterson experiences a night of little ease, troubled by questions.", "source_chunk": "jekyll_hyde-9"}
|
| 59 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Utterson envisions a child being trodden down by a man.", "source_chunk": "jekyll_hyde-9"}
|
| 60 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Utterson imagines a friend asleep and dreaming.", "source_chunk": "jekyll_hyde-9"}
|
| 61 |
+
{"type": "setting", "entity": "Room", "text": "Room in a rich house", "source_chunk": "jekyll_hyde-10"}
|
| 62 |
+
{"type": "event", "entity": "Mr. Hyde", "text": "Lawyer's curiosity to behold the features of Mr. Hyde grows", "source_chunk": "jekyll_hyde-10"}
|
| 63 |
+
{"type": "event", "entity": "Mr. Utterson", "text": "Mr. Utterson begins to haunt the door in the by-street of shops", "source_chunk": "jekyll_hyde-10"}
|
| 64 |
+
{"type": "rule", "entity": "Curiosity", "text": "Curiosity about mysterious things can lighten when examined", "source_chunk": "jekyll_hyde-10"}
|
| 65 |
+
{"type": "location", "entity": "by-street of shops", "text": "Mr. Utterson's chosen post for waiting", "source_chunk": "jekyll_hyde-10"}
|
| 66 |
+
{"type": "setting", "entity": "fogged city moon", "text": "Night setting under the fogged city moon", "source_chunk": "jekyll_hyde-10"}
|
| 67 |
+
{"type": "event", "entity": "Lawyer", "text": "Lawyer waits at his post to confront Mr. Hyde.", "source_chunk": "jekyll_hyde-11"}
|
| 68 |
+
{"type": "setting", "entity": "London", "text": "Nighttime in London, described as solitary and silent with clean streets.", "source_chunk": "jekyll_hyde-11"}
|
| 69 |
+
{"type": "rule", "entity": "Lawyer", "text": "Lawyer has a superstitious prevision of success during his patrol.", "source_chunk": "jekyll_hyde-11"}
|
| 70 |
+
{"type": "event", "entity": "Mr. Hyde", "text": "Mr. Hyde approaches the door, drawing a key from his pocket.", "source_chunk": "jekyll_hyde-11"}
|
| 71 |
+
{"type": "event", "entity": "Mr. Utterson", "text": "Mr. Utterson identifies Mr. Hyde and touches him on the shoulder.", "source_chunk": "jekyll_hyde-11"}
|
| 72 |
+
{"type": "organization", "entity": "Dr. Jekyll", "text": "Mr. Utterson is an old friend of Dr. Jekyll.", "source_chunk": "jekyll_hyde-12"}
|
| 73 |
+
{"type": "location", "entity": "Soho", "text": "Mr. Hyde gave a number of a street in Soho.", "source_chunk": "jekyll_hyde-12"}
|
| 74 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Utterson and Mr. Hyde meet and discuss Dr. Jekyll.", "source_chunk": "jekyll_hyde-12"}
|
| 75 |
+
{"type": "rule", "entity": "Mr", "text": "Mr. Utterson requests to see Mr. Hyde's face.", "source_chunk": "jekyll_hyde-12"}
|
| 76 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Hyde unlocks the door and disappears into the house.", "source_chunk": "jekyll_hyde-12"}
|
| 77 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Hyde left the lawyer, causing disquietude.", "source_chunk": "jekyll_hyde-13"}
|
| 78 |
+
{"type": "event", "entity": "Lawyer", "text": "Lawyer debated a perplexing problem while walking.", "source_chunk": "jekyll_hyde-13"}
|
| 79 |
+
{"type": "rule", "entity": "Disgust", "text": "Disgust, loathing, and fear can arise from unknown sources.", "source_chunk": "jekyll_hyde-13"}
|
| 80 |
+
{"type": "setting", "entity": "Square", "text": "Square of ancient, handsome houses, now decayed.", "source_chunk": "jekyll_hyde-13"}
|
| 81 |
+
{"type": "location", "entity": "Dr. Jekyll's house", "text": "House occupied entirely, exuding wealth and comfort.", "source_chunk": "jekyll_hyde-13"}
|
| 82 |
+
{"type": "organization", "entity": "map-engravers, architects, shady lawyers", "text": "Various professions reside in the decayed houses.", "source_chunk": "jekyll_hyde-13"}
|
| 83 |
+
{"type": "event", "entity": "Poole", "text": "Servant opened the door for Mr. Utterson.", "source_chunk": "jekyll_hyde-13"}
|
| 84 |
+
{"type": "location", "entity": "hall", "text": "Large, low-roofed, comfortable hall paved with flags, warmed by a bright, open fire.", "source_chunk": "jekyll_hyde-14"}
|
| 85 |
+
{"type": "setting", "entity": "London", "text": "Utterson speaks of the hall as the pleasantest room in London.", "source_chunk": "jekyll_hyde-14"}
|
| 86 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson visits Dr. Jekyll's home and learns that Jekyll is not at home.", "source_chunk": "jekyll_hyde-14"}
|
| 87 |
+
{"type": "organization", "entity": "servants", "text": "All orders to obey Mr. Hyde.", "source_chunk": "jekyll_hyde-14"}
|
| 88 |
+
{"type": "rule", "entity": "Mr", "text": "Mr. Hyde has a key and can enter the house when Dr. Jekyll is away.", "source_chunk": "jekyll_hyde-14"}
|
| 89 |
+
{"type": "event", "entity": "Mr. Hyde", "text": "Utterson sees Mr. Hyde enter by the old dissecting room.", "source_chunk": "jekyll_hyde-14"}
|
| 90 |
+
{"type": "event", "entity": "Lawyer", "text": "Lawyer reflects on Harry Jekyll's troubled state and past sins.", "source_chunk": "jekyll_hyde-15"}
|
| 91 |
+
{"type": "rule", "entity": "law of God", "text": "No statute of limitations exists for sins.", "source_chunk": "jekyll_hyde-15"}
|
| 92 |
+
{"type": "setting", "entity": "Lawyer", "text": "Lawyer feels heavy-hearted while returning home.", "source_chunk": "jekyll_hyde-15"}
|
| 93 |
+
{"type": "event", "entity": "Master Hyde", "text": "Lawyer contemplates the dark secrets of Master Hyde.", "source_chunk": "jekyll_hyde-15"}
|
| 94 |
+
{"type": "event", "entity": "Harry Jekyll", "text": "Lawyer worries about Hyde's potential impatience to inherit Jekyll's estate.", "source_chunk": "jekyll_hyde-15"}
|
| 95 |
+
{"type": "event", "entity": "Lawyer", "text": "Lawyer resolves to take action regarding Jekyll's situation.", "source_chunk": "jekyll_hyde-15"}
|
| 96 |
+
{"type": "event", "entity": "Dr", "text": "Dr. Jekyll hosted a dinner for old cronies.", "source_chunk": "jekyll_hyde-16"}
|
| 97 |
+
{"type": "rule", "entity": "Utterson", "text": "Utterson often remained behind after gatherings.", "source_chunk": "jekyll_hyde-16"}
|
| 98 |
+
{"type": "setting", "entity": null, "text": "A warm and pleasant dinner atmosphere.", "source_chunk": "jekyll_hyde-16"}
|
| 99 |
+
{"type": "organization", "entity": "Lanyon", "text": "Lanyon is described as a hide-bound pedant and a good fellow.", "source_chunk": "jekyll_hyde-16"}
|
| 100 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson expressed concern about Jekyll's will.", "source_chunk": "jekyll_hyde-16"}
|
| 101 |
+
{"type": "rule", "entity": "Utterson", "text": "Utterson disapproved of Jekyll's will.", "source_chunk": "jekyll_hyde-16"}
|
| 102 |
+
{"type": "event", "entity": "Hyde", "text": "Utterson learned something about young Hyde.", "source_chunk": "jekyll_hyde-16"}
|
| 103 |
+
{"type": "event", "entity": "Doctor", "text": "Doctor expresses discomfort about discussing young Hyde.", "source_chunk": "jekyll_hyde-17"}
|
| 104 |
+
{"type": "rule", "entity": "Doctor", "text": "Doctor insists on keeping matters private and not discussing them further.", "source_chunk": "jekyll_hyde-17"}
|
| 105 |
+
{"type": "setting", "entity": "Conversation", "text": "Conversation takes place in a private setting, indicated by the request to let the matter sleep.", "source_chunk": "jekyll_hyde-17"}
|
| 106 |
+
{"type": "organization", "entity": "Utterson", "text": "Utterson is portrayed as a trusted friend and confidant.", "source_chunk": "jekyll_hyde-17"}
|
| 107 |
+
{"type": "location", "entity": "Fire", "text": "Fire is present, indicating a warm, intimate atmosphere during the conversation.", "source_chunk": "jekyll_hyde-17"}
|
| 108 |
+
{"type": "event", "entity": "Jekyll", "text": "Jekyll expresses concern for Hyde and asks Utterson to help him.", "source_chunk": "jekyll_hyde-18"}
|
| 109 |
+
{"type": "rule", "entity": "Jekyll", "text": "Jekyll requests Utterson to ensure justice for Hyde.", "source_chunk": "jekyll_hyde-18"}
|
| 110 |
+
{"type": "organization", "entity": "Utterson", "text": "Utterson is a lawyer who is asked to assist Hyde.", "source_chunk": "jekyll_hyde-18"}
|
| 111 |
+
{"type": "setting", "entity": "Jekyll", "text": "Jekyll is concerned about his legacy and the treatment of Hyde.", "source_chunk": "jekyll_hyde-18"}
|
| 112 |
+
{"type": "event", "entity": "Crime", "text": "Crime of singular ferocity occurred in London, notable due to high position of victim.", "source_chunk": "jekyll_hyde-19"}
|
| 113 |
+
{"type": "location", "entity": "London", "text": "Setting of the crime, city was startled by the event.", "source_chunk": "jekyll_hyde-19"}
|
| 114 |
+
{"type": "setting", "entity": "Time", "text": "Time of year was October, with a cloudless night and full moon.", "source_chunk": "jekyll_hyde-19"}
|
| 115 |
+
{"type": "organization", "entity": "Maid", "text": "Maid servant living alone in a house near the river.", "source_chunk": "jekyll_hyde-19"}
|
| 116 |
+
{"type": "rule", "entity": "Maid", "text": "Maid felt at peace with all men and thought kindly of the world.", "source_chunk": "jekyll_hyde-19"}
|
| 117 |
+
{"type": "event", "entity": "Mr. Hyde", "text": "Maid recognized Mr. Hyde, whom she disliked, during the encounter.", "source_chunk": "jekyll_hyde-19"}
|
| 118 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Hyde displayed anger and impatience during the encounter.", "source_chunk": "jekyll_hyde-19"}
|
| 119 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Hyde attacked and killed Sir Danvers Carew in a violent outburst.", "source_chunk": "jekyll_hyde-20"}
|
| 120 |
+
{"type": "location", "entity": "lane", "text": "Victim found in the middle of the lane, incredibly mangled.", "source_chunk": "jekyll_hyde-20"}
|
| 121 |
+
{"type": "organization", "entity": "police", "text": "Maid called for the police after witnessing the murder.", "source_chunk": "jekyll_hyde-20"}
|
| 122 |
+
{"type": "rule", "entity": "Murderer", "text": "Murderer fled the scene, leaving the victim behind.", "source_chunk": "jekyll_hyde-20"}
|
| 123 |
+
{"type": "setting", "entity": "Scene", "text": "Scene described with horror, maid fainted at the sight.", "source_chunk": "jekyll_hyde-20"}
|
| 124 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Utterson received a sealed envelope with the victim's name and address.", "source_chunk": "jekyll_hyde-20"}
|
| 125 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Utterson recognized the victim as Sir Danvers Carew at the police station.", "source_chunk": "jekyll_hyde-20"}
|
| 126 |
+
{"type": "event", "entity": "Sir Danvers Carew", "text": "Recognition of Sir Danvers Carew's body in the cell.", "source_chunk": "jekyll_hyde-21"}
|
| 127 |
+
{"type": "event", "entity": "Hyde", "text": "Discussion of Mr. Hyde's involvement in the incident.", "source_chunk": "jekyll_hyde-21"}
|
| 128 |
+
{"type": "rule", "entity": "Professional", "text": "Professional ambition drives the officer to seek the perpetrator.", "source_chunk": "jekyll_hyde-21"}
|
| 129 |
+
{"type": "location", "entity": "Soho", "text": "Dismal quarter of Soho described as dark and nightmarish.", "source_chunk": "jekyll_hyde-21"}
|
| 130 |
+
{"type": "setting", "entity": "First", "text": "First fog of the season creates a gloomy atmosphere.", "source_chunk": "jekyll_hyde-21"}
|
| 131 |
+
{"type": "event", "entity": "cab ride", "text": "Mr. Utterson offers to take the officer to Hyde's house.", "source_chunk": "jekyll_hyde-21"}
|
| 132 |
+
{"type": "setting", "entity": null, "text": "A district of some city in a nightmare, described as dingy with a foggy atmosphere.", "source_chunk": "jekyll_hyde-22"}
|
| 133 |
+
{"type": "location", "entity": "gin palace", "text": "Presence of a gin palace in the street.", "source_chunk": "jekyll_hyde-22"}
|
| 134 |
+
{"type": "location", "entity": "low French eating house", "text": "A low French eating house is mentioned in the street.", "source_chunk": "jekyll_hyde-22"}
|
| 135 |
+
{"type": "location", "entity": "shop for the retail of penny numbers and twopenny salads", "text": "A shop selling penny numbers and twopenny salads is present.", "source_chunk": "jekyll_hyde-22"}
|
| 136 |
+
{"type": "event", "entity": "Mr. Hyde's absence", "text": "Mr. Hyde was not at home and had irregular habits.", "source_chunk": "jekyll_hyde-22"}
|
| 137 |
+
{"type": "organization", "entity": "Scotland Yard", "text": "Inspector Newcomen is associated with Scotland Yard.", "source_chunk": "jekyll_hyde-22"}
|
| 138 |
+
{"type": "rule", "entity": "Law", "text": "Law and its officers instill a sense of terror even in honest individuals.", "source_chunk": "jekyll_hyde-22"}
|
| 139 |
+
{"type": "event", "entity": "Mr. Hyde's trouble", "text": "The old woman expresses joy at the news of Mr. Hyde being in trouble.", "source_chunk": "jekyll_hyde-22"}
|
| 140 |
+
{"type": "setting", "entity": "House", "text": "House furnished with luxury and good taste, but recently ransacked.", "source_chunk": "jekyll_hyde-23"}
|
| 141 |
+
{"type": "event", "entity": "Rooms", "text": "Rooms showed signs of having been hurriedly ransacked; clothes on the floor, drawers open.", "source_chunk": "jekyll_hyde-23"}
|
| 142 |
+
{"type": "event", "entity": "Inspector", "text": "Inspector found a burnt cheque book and a stick, leading to suspicions about Mr. Hyde.", "source_chunk": "jekyll_hyde-23"}
|
| 143 |
+
{"type": "organization", "entity": "bank", "text": "Several thousand pounds found to be lying to the murderer's credit.", "source_chunk": "jekyll_hyde-23"}
|
| 144 |
+
{"type": "rule", "entity": "Money", "text": "Money is considered vital to Mr. Hyde, as indicated by the inspector's comments.", "source_chunk": "jekyll_hyde-23"}
|
| 145 |
+
{"type": "location", "entity": "Mr", "text": "Mr. Hyde had few familiars and could not be easily traced.", "source_chunk": "jekyll_hyde-23"}
|
| 146 |
+
{"type": "event", "entity": "Witnesses", "text": "Witnesses described Mr. Hyde with a haunting sense of unexpressed deformity.", "source_chunk": "jekyll_hyde-23"}
|
| 147 |
+
{"type": "location", "entity": "Dr. Jekyll’s door", "text": "Mr. Utterson found his way to Dr. Jekyll’s door.", "source_chunk": "jekyll_hyde-24"}
|
| 148 |
+
{"type": "location", "entity": "laboratory", "text": "Mr. Utterson was carried down to the building which was indifferently known as the laboratory.", "source_chunk": "jekyll_hyde-24"}
|
| 149 |
+
{"type": "location", "entity": "dissecting rooms", "text": "Mr. Utterson was carried down to the building which was indifferently known as the dissecting rooms.", "source_chunk": "jekyll_hyde-24"}
|
| 150 |
+
{"type": "location", "entity": "garden", "text": "Mr. Utterson crossed a yard which had once been a garden.", "source_chunk": "jekyll_hyde-24"}
|
| 151 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Utterson was received in that part of his friend’s quarters for the first time.", "source_chunk": "jekyll_hyde-24"}
|
| 152 |
+
{"type": "setting", "entity": "theatre", "text": "The theatre was once crowded with eager students and now lying gaunt and silent.", "source_chunk": "jekyll_hyde-24"}
|
| 153 |
+
{"type": "setting", "entity": "doctor’s cabinet", "text": "Mr. Utterson was received into the doctor’s cabinet.", "source_chunk": "jekyll_hyde-24"}
|
| 154 |
+
{"type": "setting", "entity": "court", "text": "The cabinet looked out upon the court by three dusty windows barred with iron.", "source_chunk": "jekyll_hyde-24"}
|
| 155 |
+
{"type": "event", "entity": "Dr", "text": "Dr. Jekyll looked deathly sick when Mr. Utterson arrived.", "source_chunk": "jekyll_hyde-24"}
|
| 156 |
+
{"type": "organization", "entity": "Carew", "text": "Carew was Mr. Utterson's client.", "source_chunk": "jekyll_hyde-24"}
|
| 157 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson expresses concern about the implications of Jekyll's relationship with Hyde.", "source_chunk": "jekyll_hyde-25"}
|
| 158 |
+
{"type": "rule", "entity": "Jekyll", "text": "Jekyll binds his honour to Utterson, indicating a moral obligation.", "source_chunk": "jekyll_hyde-25"}
|
| 159 |
+
{"type": "organization", "entity": "police", "text": "Jekyll contemplates whether to show a letter to the police.", "source_chunk": "jekyll_hyde-25"}
|
| 160 |
+
{"type": "setting", "entity": "dining-room", "text": "The conversation takes place in a dining-room.", "source_chunk": "jekyll_hyde-25"}
|
| 161 |
+
{"type": "event", "entity": "Jekyll", "text": "Jekyll declares he is done with Hyde and expresses concern for his own character.", "source_chunk": "jekyll_hyde-25"}
|
| 162 |
+
{"type": "event", "entity": "Hyde", "text": "Hyde writes a letter to Jekyll, indicating he has means of escape.", "source_chunk": "jekyll_hyde-25"}
|
| 163 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson learns about a letter that was handed in without a postmark.", "source_chunk": "jekyll_hyde-26"}
|
| 164 |
+
{"type": "event", "entity": "Jekyll", "text": "Jekyll expresses loss of confidence in himself.", "source_chunk": "jekyll_hyde-26"}
|
| 165 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson suspects Hyde intended to murder Jekyll.", "source_chunk": "jekyll_hyde-26"}
|
| 166 |
+
{"type": "event", "entity": "Jekyll", "text": "Jekyll reflects on having learned a significant lesson.", "source_chunk": "jekyll_hyde-26"}
|
| 167 |
+
{"type": "location", "entity": "laboratory", "text": "Letter possibly came from the laboratory door.", "source_chunk": "jekyll_hyde-26"}
|
| 168 |
+
{"type": "location", "entity": "cabinet", "text": "Letter may have been written in the cabinet.", "source_chunk": "jekyll_hyde-26"}
|
| 169 |
+
{"type": "event", "entity": "Newsboys", "text": "Newsboys announce a shocking murder of an M.P.", "source_chunk": "jekyll_hyde-26"}
|
| 170 |
+
{"type": "organization", "entity": "M.P.", "text": "M.P. is mentioned in relation to a shocking murder.", "source_chunk": "jekyll_hyde-26"}
|
| 171 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson feels apprehension about the potential scandal affecting Jekyll.", "source_chunk": "jekyll_hyde-26"}
|
| 172 |
+
{"type": "event", "entity": "Decision", "text": "Decision-making process involves seeking advice.", "source_chunk": "jekyll_hyde-27"}
|
| 173 |
+
{"type": "setting", "entity": "hearth", "text": "Conversation takes place by the hearth with firelight.", "source_chunk": "jekyll_hyde-27"}
|
| 174 |
+
{"type": "location", "entity": "London", "text": "Fog covers the city, described as a drowned city.", "source_chunk": "jekyll_hyde-27"}
|
| 175 |
+
{"type": "organization", "entity": "law firm", "text": "Utterson is a lawyer, indicating a legal profession.", "source_chunk": "jekyll_hyde-27"}
|
| 176 |
+
{"type": "event", "entity": "Sir Danvers", "text": "Public feeling elicited by the sad business about Sir Danvers.", "source_chunk": "jekyll_hyde-27"}
|
| 177 |
+
{"type": "rule", "entity": "Secrecy", "text": "Secrecy maintained in professional relationships.", "source_chunk": "jekyll_hyde-27"}
|
| 178 |
+
{"type": "event", "entity": "Mr. Hyde", "text": "Mr. Hyde's familiarity with the house raises suspicions.", "source_chunk": "jekyll_hyde-27"}
|
| 179 |
+
{"type": "event", "entity": "Public", "text": "Public feeling elicited by Sir Danvers' situation.", "source_chunk": "jekyll_hyde-28"}
|
| 180 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson receives a document in a murderer's handwriting.", "source_chunk": "jekyll_hyde-28"}
|
| 181 |
+
{"type": "event", "entity": "Guest", "text": "Guest compares two sheets of paper for handwriting similarities.", "source_chunk": "jekyll_hyde-28"}
|
| 182 |
+
{"type": "rule", "entity": "Utterson", "text": "Utterson instructs Guest to keep the note private.", "source_chunk": "jekyll_hyde-28"}
|
| 183 |
+
{"type": "setting", "entity": "Utterson", "text": "Utterson locks the note into his safe.", "source_chunk": "jekyll_hyde-28"}
|
| 184 |
+
{"type": "organization", "entity": "Dr. Jekyll", "text": "Utterson suspects Dr. Jekyll of forging for a murderer.", "source_chunk": "jekyll_hyde-28"}
|
| 185 |
+
{"type": "event", "entity": "death of Sir Danvers", "text": "Death of Sir Danvers was resented as a public injury.", "source_chunk": "jekyll_hyde-29"}
|
| 186 |
+
{"type": "event", "entity": "disappearance of Mr. Hyde", "text": "Mr. Hyde disappeared out of the ken of the police as though he had never existed.", "source_chunk": "jekyll_hyde-29"}
|
| 187 |
+
{"type": "rule", "entity": "Much", "text": "Much of Mr. Hyde's past was unearthed, revealing tales of cruelty and a vile life.", "source_chunk": "jekyll_hyde-29"}
|
| 188 |
+
{"type": "setting", "entity": "Soho", "text": "Mr. Hyde left the house in Soho on the morning of the murder.", "source_chunk": "jekyll_hyde-29"}
|
| 189 |
+
{"type": "event", "entity": "new life for Dr. Jekyll", "text": "With Mr. Hyde's disappearance, a new life began for Dr. Jekyll.", "source_chunk": "jekyll_hyde-29"}
|
| 190 |
+
{"type": "event", "entity": "dinner with Utterson and Lanyon", "text": "Utterson dined at Dr. Jekyll's with a small party including Lanyon.", "source_chunk": "jekyll_hyde-29"}
|
| 191 |
+
{"type": "event", "entity": "return of solitude", "text": "Utterson found the return of solitude to weigh upon his spirits.", "source_chunk": "jekyll_hyde-29"}
|
| 192 |
+
{"type": "event", "entity": "refusal of visits", "text": "Dr. Jekyll was confined to the house and saw no one on multiple occasions.", "source_chunk": "jekyll_hyde-29"}
|
| 193 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson visits Dr. Lanyon and observes his physical and mental decline.", "source_chunk": "jekyll_hyde-30"}
|
| 194 |
+
{"type": "event", "entity": "Lanyon", "text": "Lanyon declares himself a doomed man after experiencing a shock.", "source_chunk": "jekyll_hyde-30"}
|
| 195 |
+
{"type": "rule", "entity": "Lanyon", "text": "Lanyon expresses a desire to no longer discuss Dr. Jekyll, whom he regards as dead.", "source_chunk": "jekyll_hyde-30"}
|
| 196 |
+
{"type": "setting", "entity": "Lanyon's residence", "text": "Utterson is admitted to Lanyon's home, indicating a place of social interaction.", "source_chunk": "jekyll_hyde-30"}
|
| 197 |
+
{"type": "location", "entity": "Utterson", "text": "Utterson reflects on the inevitability of death and the value of life.", "source_chunk": "jekyll_hyde-30"}
|
| 198 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson receives a long answer from Jekyll, expressing a desire for extreme seclusion.", "source_chunk": "jekyll_hyde-31"}
|
| 199 |
+
{"type": "rule", "entity": "Jekyll", "text": "Jekyll insists on never meeting Lanyon again.", "source_chunk": "jekyll_hyde-31"}
|
| 200 |
+
{"type": "event", "entity": "Dr. Lanyon", "text": "Dr. Lanyon takes to his bed and dies shortly after.", "source_chunk": "jekyll_hyde-31"}
|
| 201 |
+
{"type": "setting", "entity": "Jekyll", "text": "Jekyll's home is described as a place where Utterson feels excluded.", "source_chunk": "jekyll_hyde-31"}
|
| 202 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson reflects on the drastic change in Jekyll's life and mental state.", "source_chunk": "jekyll_hyde-31"}
|
| 203 |
+
{"type": "rule", "entity": "Utterson", "text": "Utterson is asked to respect Jekyll's silence regarding his troubles.", "source_chunk": "jekyll_hyde-31"}
|
| 204 |
+
{"type": "event", "entity": "Dr. Lanyon", "text": "Dr. Lanyon took to his bed and died within a fortnight.", "source_chunk": "jekyll_hyde-32"}
|
| 205 |
+
{"type": "event", "entity": "funeral", "text": "Utterson was sadly affected at the funeral.", "source_chunk": "jekyll_hyde-32"}
|
| 206 |
+
{"type": "rule", "entity": "Envelope", "text": "Envelope addressed to Utterson marked 'PRIVATE' and to be destroyed unread in case of his predecease.", "source_chunk": "jekyll_hyde-32"}
|
| 207 |
+
{"type": "rule", "entity": "Dr. Henry Jekyll", "text": "Another enclosure marked 'not to be opened till the death or disappearance of Dr. Henry Jekyll.'", "source_chunk": "jekyll_hyde-32"}
|
| 208 |
+
{"type": "organization", "entity": "Utterson", "text": "Utterson is a trustee with obligations of professional honour and faith to his dead friend.", "source_chunk": "jekyll_hyde-32"}
|
| 209 |
+
{"type": "setting", "entity": "business room", "text": "Utterson locked the door of his business room and sat by the light of a melancholy candle.", "source_chunk": "jekyll_hyde-32"}
|
| 210 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson experienced disquiet and fear regarding his surviving friend.", "source_chunk": "jekyll_hyde-32"}
|
| 211 |
+
{"type": "location", "entity": "open city", "text": "open city", "source_chunk": "jekyll_hyde-33"}
|
| 212 |
+
{"type": "location", "entity": "house of voluntary bondage", "text": "house of voluntary bondage", "source_chunk": "jekyll_hyde-33"}
|
| 213 |
+
{"type": "setting", "entity": null, "text": "cabinet over the laboratory", "source_chunk": "jekyll_hyde-33"}
|
| 214 |
+
{"type": "event", "entity": null, "text": "doctor confined himself", "source_chunk": "jekyll_hyde-33"}
|
| 215 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson fell off in frequency of visits", "source_chunk": "jekyll_hyde-33"}
|
| 216 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Utterson and Mr. Enfield walk through a by-street and stop in front of a door.", "source_chunk": "jekyll_hyde-34"}
|
| 217 |
+
{"type": "event", "entity": "Mr. Hyde", "text": "Mr. Enfield declares that the story of Mr. Hyde is at an end.", "source_chunk": "jekyll_hyde-34"}
|
| 218 |
+
{"type": "event", "entity": "Dr. Jekyll", "text": "Utterson expresses unease about Dr. Jekyll's well-being.", "source_chunk": "jekyll_hyde-34"}
|
| 219 |
+
{"type": "setting", "entity": "court", "text": "The court is described as cool, damp, and full of premature twilight.", "source_chunk": "jekyll_hyde-34"}
|
| 220 |
+
{"type": "organization", "entity": "lawyer", "text": "Utterson is identified as a lawyer.", "source_chunk": "jekyll_hyde-34"}
|
| 221 |
+
{"type": "rule", "entity": "Dr", "text": "Dr. Jekyll feels he cannot go out and socialize.", "source_chunk": "jekyll_hyde-34"}
|
| 222 |
+
{"type": "event", "entity": "Doctor", "text": "Doctor's expression changes to abject terror and despair.", "source_chunk": "jekyll_hyde-35"}
|
| 223 |
+
{"type": "location", "entity": "by-street", "text": "Gentlemen traverse a by-street in silence.", "source_chunk": "jekyll_hyde-35"}
|
| 224 |
+
{"type": "location", "entity": "neighbouring thoroughfare", "text": "Gentlemen enter a neighbouring thoroughfare with some stirrings of life.", "source_chunk": "jekyll_hyde-35"}
|
| 225 |
+
{"type": "rule", "entity": "Silence", "text": "Silence observed after witnessing the doctor's terror.", "source_chunk": "jekyll_hyde-35"}
|
| 226 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Utterson expresses a plea for forgiveness.", "source_chunk": "jekyll_hyde-35"}
|
| 227 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Utterson receives a visit from Poole.", "source_chunk": "jekyll_hyde-36"}
|
| 228 |
+
{"type": "event", "entity": "Poole", "text": "Poole expresses fear about the doctor being shut up in the cabinet.", "source_chunk": "jekyll_hyde-36"}
|
| 229 |
+
{"type": "event", "entity": "Poole", "text": "Poole mentions he has been afraid for about a week.", "source_chunk": "jekyll_hyde-36"}
|
| 230 |
+
{"type": "event", "entity": "Poole", "text": "Poole suggests there has been foul play.", "source_chunk": "jekyll_hyde-36"}
|
| 231 |
+
{"type": "setting", "entity": "March", "text": "A wild, cold night in March with a pale moon.", "source_chunk": "jekyll_hyde-36"}
|
| 232 |
+
{"type": "location", "entity": "cabinet", "text": "Doctor is shut up in the cabinet.", "source_chunk": "jekyll_hyde-36"}
|
| 233 |
+
{"type": "organization", "entity": "lawyer", "text": "Mr. Utterson is a lawyer.", "source_chunk": "jekyll_hyde-36"}
|
| 234 |
+
{"type": "setting", "entity": "March", "text": "wild, cold, seasonable night of March with a pale moon and flying wrack", "source_chunk": "jekyll_hyde-37"}
|
| 235 |
+
{"type": "location", "entity": "London", "text": "part of London unusually bare of passengers", "source_chunk": "jekyll_hyde-37"}
|
| 236 |
+
{"type": "event", "entity": "Mr", "text": "Mr. Utterson felt a crushing anticipation of calamity", "source_chunk": "jekyll_hyde-37"}
|
| 237 |
+
{"type": "setting", "entity": null, "text": "square full of wind and dust with thin trees lashing along the railing", "source_chunk": "jekyll_hyde-37"}
|
| 238 |
+
{"type": "event", "entity": "Poole", "text": "Poole showed signs of strangling anguish", "source_chunk": "jekyll_hyde-37"}
|
| 239 |
+
{"type": "organization", "entity": "servants", "text": "servants stood huddled together like a flock of sheep", "source_chunk": "jekyll_hyde-37"}
|
| 240 |
+
{"type": "event", "entity": "Mr", "text": "housemaid broke into hysterical whimpering upon seeing Mr. Utterson", "source_chunk": "jekyll_hyde-37"}
|
| 241 |
+
{"type": "event", "entity": "Housemaid", "text": "Housemaid broke into hysterical whimpering.", "source_chunk": "jekyll_hyde-38"}
|
| 242 |
+
{"type": "event", "entity": "Cook", "text": "Cook cried out in relief upon seeing Mr. Utterson.", "source_chunk": "jekyll_hyde-38"}
|
| 243 |
+
{"type": "event", "entity": "Poole", "text": "Poole indicated that everyone was afraid.", "source_chunk": "jekyll_hyde-38"}
|
| 244 |
+
{"type": "event", "entity": "Maid", "text": "Maid wept loudly, causing a reaction from others.", "source_chunk": "jekyll_hyde-38"}
|
| 245 |
+
{"type": "event", "entity": "Poole", "text": "Poole commanded the maid to be quiet.", "source_chunk": "jekyll_hyde-38"}
|
| 246 |
+
{"type": "event", "entity": "Poole", "text": "Poole asked the knife-boy for a candle.", "source_chunk": "jekyll_hyde-38"}
|
| 247 |
+
{"type": "event", "entity": "Poole", "text": "Poole warned Mr. Utterson not to enter if asked.", "source_chunk": "jekyll_hyde-38"}
|
| 248 |
+
{"type": "location", "entity": "laboratory building", "text": "Mr. Utterson followed Poole into the laboratory building.", "source_chunk": "jekyll_hyde-38"}
|
| 249 |
+
{"type": "location", "entity": "surgical theatre", "text": "They passed through the surgical theatre.", "source_chunk": "jekyll_hyde-38"}
|
| 250 |
+
{"type": "event", "entity": "Poole", "text": "Poole knocked on the cabinet door.", "source_chunk": "jekyll_hyde-38"}
|
| 251 |
+
{"type": "event", "entity": null, "text": "A voice from within the cabinet refused to see anyone.", "source_chunk": "jekyll_hyde-38"}
|
| 252 |
+
{"type": "event", "entity": "Master", "text": "Master made away with eight days ago, leading to strange occurrences.", "source_chunk": "jekyll_hyde-39"}
|
| 253 |
+
{"type": "rule", "entity": "Master", "text": "Master's voice is recognized by the butler, indicating familiarity and trust.", "source_chunk": "jekyll_hyde-39"}
|
| 254 |
+
{"type": "setting", "entity": "Great", "text": "Great kitchen with an out fire and leaping beetles on the floor.", "source_chunk": "jekyll_hyde-39"}
|
| 255 |
+
{"type": "event", "entity": "Crying", "text": "Crying for medicine from the entity in the cabinet, indicating desperation.", "source_chunk": "jekyll_hyde-39"}
|
| 256 |
+
{"type": "organization", "entity": "wholesale chemists", "text": "Orders sent to various chemists in town for specific medicine.", "source_chunk": "jekyll_hyde-39"}
|
| 257 |
+
{"type": "event", "entity": "Papers", "text": "Papers left with orders and complaints, indicating a sense of urgency.", "source_chunk": "jekyll_hyde-39"}
|
| 258 |
+
{"type": "event", "entity": "Dr", "text": "Dr. Jekyll requests a search for a specific drug due to previous samples being impure.", "source_chunk": "jekyll_hyde-40"}
|
| 259 |
+
{"type": "rule", "entity": "Dr", "text": "Dr. Jekyll emphasizes the importance of obtaining pure drug samples.", "source_chunk": "jekyll_hyde-40"}
|
| 260 |
+
{"type": "organization", "entity": "Messrs. Maw", "text": "Dr. Jekyll communicates with Messrs. Maw regarding the quality of drug samples.", "source_chunk": "jekyll_hyde-40"}
|
| 261 |
+
{"type": "setting", "entity": "theatre", "text": "Poole describes entering the theatre from the garden where he saw Dr. Jekyll.", "source_chunk": "jekyll_hyde-40"}
|
| 262 |
+
{"type": "event", "entity": "Poole", "text": "Poole witnesses Dr. Jekyll in a state of distress while searching for the drug.", "source_chunk": "jekyll_hyde-40"}
|
| 263 |
+
{"type": "event", "entity": "Dr", "text": "Dr. Jekyll is seen wearing a mask, raising concerns about his identity.", "source_chunk": "jekyll_hyde-40"}
|
| 264 |
+
{"type": "event", "entity": "Poole", "text": "Poole witnesses a masked figure that he believes is not his master.", "source_chunk": "jekyll_hyde-41"}
|
| 265 |
+
{"type": "rule", "entity": "Utterson", "text": "Utterson feels a duty to investigate the truth behind the masked figure.", "source_chunk": "jekyll_hyde-41"}
|
| 266 |
+
{"type": "setting", "entity": "cabinet", "text": "The scene takes place in a cabinet where the masked figure is seen.", "source_chunk": "jekyll_hyde-41"}
|
| 267 |
+
{"type": "organization", "entity": "lawyer", "text": "Utterson is identified as a lawyer who is concerned about his friend's well-being.", "source_chunk": "jekyll_hyde-41"}
|
| 268 |
+
{"type": "event", "entity": "Poole", "text": "Poole expresses belief that murder has occurred.", "source_chunk": "jekyll_hyde-41"}
|
| 269 |
+
{"type": "rule", "entity": "Poole", "text": "Poole asserts his long service allows him to recognize his master.", "source_chunk": "jekyll_hyde-41"}
|
| 270 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson and Poole prepare to break down a door.", "source_chunk": "jekyll_hyde-42"}
|
| 271 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson and Poole discuss the presence of a masked figure.", "source_chunk": "jekyll_hyde-42"}
|
| 272 |
+
{"type": "organization", "entity": "theatre", "text": "An axe is mentioned to be in the theatre.", "source_chunk": "jekyll_hyde-42"}
|
| 273 |
+
{"type": "rule", "entity": "Utterson", "text": "Utterson expresses duty to ensure Poole is not a loser in their perilous situation.", "source_chunk": "jekyll_hyde-42"}
|
| 274 |
+
{"type": "location", "entity": "laboratory", "text": "The laboratory door is referenced as a point of entry for Mr. Hyde.", "source_chunk": "jekyll_hyde-42"}
|
| 275 |
+
{"type": "event", "entity": "Mr. Hyde", "text": "Poole suspects the masked figure to be Mr. Hyde.", "source_chunk": "jekyll_hyde-42"}
|
| 276 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson acknowledges feeling something unsettling about Mr. Hyde.", "source_chunk": "jekyll_hyde-42"}
|
| 277 |
+
{"type": "event", "entity": "Poole", "text": "Poole describes a masked figure resembling a monkey jumping from among chemicals.", "source_chunk": "jekyll_hyde-43"}
|
| 278 |
+
{"type": "event", "entity": "Mr. Hyde", "text": "Poole believes the masked figure was Mr. Hyde.", "source_chunk": "jekyll_hyde-43"}
|
| 279 |
+
{"type": "event", "entity": "Harry", "text": "Lawyer fears that Harry is killed and believes his murderer is still present.", "source_chunk": "jekyll_hyde-43"}
|
| 280 |
+
{"type": "rule", "entity": "Lawyer", "text": "Lawyer intends to force entry into the cabinet to confront the situation.", "source_chunk": "jekyll_hyde-43"}
|
| 281 |
+
{"type": "location", "entity": "laboratory", "text": "Bradshaw and the boy are instructed to guard the laboratory door.", "source_chunk": "jekyll_hyde-43"}
|
| 282 |
+
{"type": "setting", "entity": "London", "text": "London is described as humming solemnly around the characters.", "source_chunk": "jekyll_hyde-43"}
|
| 283 |
+
{"type": "event", "entity": "Characters", "text": "Characters wait silently in the shelter of the theatre.", "source_chunk": "jekyll_hyde-43"}
|
| 284 |
+
{"type": "event", "entity": "Footfall", "text": "Footfall moving to and fro along the cabinet floor.", "source_chunk": "jekyll_hyde-44"}
|
| 285 |
+
{"type": "event", "entity": "Poole", "text": "Poole mentions a break when a new sample comes from the chemist.", "source_chunk": "jekyll_hyde-44"}
|
| 286 |
+
{"type": "event", "entity": "Poole", "text": "Poole hears weeping, described as like a woman or a lost soul.", "source_chunk": "jekyll_hyde-44"}
|
| 287 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson demands to see Jekyll, threatening to use brute force.", "source_chunk": "jekyll_hyde-44"}
|
| 288 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson recognizes Hyde's voice instead of Jekyll's.", "source_chunk": "jekyll_hyde-44"}
|
| 289 |
+
{"type": "event", "entity": "Poole", "text": "Poole swings an axe to break down the door.", "source_chunk": "jekyll_hyde-44"}
|
| 290 |
+
{"type": "setting", "entity": "Quiet", "text": "Quiet of the night.", "source_chunk": "jekyll_hyde-44"}
|
| 291 |
+
{"type": "location", "entity": "cabinet", "text": "Footfall and weeping occur in the cabinet.", "source_chunk": "jekyll_hyde-44"}
|
| 292 |
+
{"type": "event", "entity": "Besiegers", "text": "Besiegers broke down the door of a cabinet.", "source_chunk": "jekyll_hyde-45"}
|
| 293 |
+
{"type": "setting", "entity": "cabinet", "text": "Cabinet contained a body, a fire glowing, and items laid out for tea.", "source_chunk": "jekyll_hyde-45"}
|
| 294 |
+
{"type": "event", "entity": "Edward Hyde", "text": "Body of Edward Hyde was found, contorted and still twitching.", "source_chunk": "jekyll_hyde-45"}
|
| 295 |
+
{"type": "rule", "entity": "Utterson", "text": "Utterson stated they had come too late to save or punish Hyde.", "source_chunk": "jekyll_hyde-45"}
|
| 296 |
+
{"type": "location", "entity": "theatre", "text": "Building occupied by a theatre and a cabinet.", "source_chunk": "jekyll_hyde-45"}
|
| 297 |
+
{"type": "location", "entity": "London", "text": "Setting described as commonplace that night in London.", "source_chunk": "jekyll_hyde-45"}
|
| 298 |
+
{"type": "location", "entity": "theatre", "text": "The theatre to the door on the by-street.", "source_chunk": "jekyll_hyde-46"}
|
| 299 |
+
{"type": "location", "entity": "cellar", "text": "Cellar filled with crazy lumber, mostly dating from the times of the surgeon who was Jekyll’s predecessor.", "source_chunk": "jekyll_hyde-46"}
|
| 300 |
+
{"type": "event", "entity": "Thorough", "text": "Thorough examination of empty closets and a cellar sealed by cobweb.", "source_chunk": "jekyll_hyde-46"}
|
| 301 |
+
{"type": "event", "entity": "Discovery", "text": "Discovery of a locked door in the by-street with a rusty key nearby.", "source_chunk": "jekyll_hyde-46"}
|
| 302 |
+
{"type": "event", "entity": "Traces", "text": "Traces of chemical work found in the cabinet.", "source_chunk": "jekyll_hyde-46"}
|
| 303 |
+
{"type": "event", "entity": "Kettle", "text": "Kettle boiled over, indicating recent activity at the fireside.", "source_chunk": "jekyll_hyde-46"}
|
| 304 |
+
{"type": "setting", "entity": "Fireside", "text": "Fireside with easy-chair and tea things ready", "source_chunk": "jekyll_hyde-47"}
|
| 305 |
+
{"type": "event", "entity": "Jekyll", "text": "Jekyll expressed great esteem for a pious work, annotated with blasphemies", "source_chunk": "jekyll_hyde-47"}
|
| 306 |
+
{"type": "event", "entity": "Poole", "text": "Poole whispers about the cheval-glass having seen strange things", "source_chunk": "jekyll_hyde-47"}
|
| 307 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson finds a will naming him instead of Edward Hyde", "source_chunk": "jekyll_hyde-47"}
|
| 308 |
+
{"type": "rule", "entity": "Will", "text": "Will serves as testament in case of death and deed of gift in case of disappearance", "source_chunk": "jekyll_hyde-47"}
|
| 309 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson receives a note from Jekyll indicating his imminent disappearance.", "source_chunk": "jekyll_hyde-48"}
|
| 310 |
+
{"type": "event", "entity": "Utterson", "text": "Utterson and Poole discuss the implications of Jekyll's potential suicide.", "source_chunk": "jekyll_hyde-48"}
|
| 311 |
+
{"type": "organization", "entity": "police", "text": "Utterson plans to send for the police after reading the documents.", "source_chunk": "jekyll_hyde-48"}
|
| 312 |
+
{"type": "setting", "entity": "theatre", "text": "Utterson and Poole lock the door of the theatre behind them.", "source_chunk": "jekyll_hyde-48"}
|
| 313 |
+
{"type": "rule", "entity": "Utterson", "text": "Utterson decides to keep the contents of the paper secret to protect Jekyll's credit.", "source_chunk": "jekyll_hyde-48"}
|
| 314 |
+
{"type": "event", "entity": "Letter", "text": "Letter received by Dr. Lanyon from Henry Jekyll on January 9.", "source_chunk": "jekyll_hyde-49"}
|
| 315 |
+
{"type": "event", "entity": "Jekyll", "text": "Jekyll expresses urgency and desperation in letter.", "source_chunk": "jekyll_hyde-49"}
|
| 316 |
+
{"type": "rule", "entity": "Jekyll", "text": "Jekyll requests Lanyon to prioritize his request over other engagements.", "source_chunk": "jekyll_hyde-49"}
|
| 317 |
+
{"type": "location", "entity": "Jekyll's house", "text": "Lanyon instructed to go to Jekyll's house.", "source_chunk": "jekyll_hyde-49"}
|
| 318 |
+
{"type": "organization", "entity": "Poole", "text": "Poole, Jekyll's butler, is involved in the plan.", "source_chunk": "jekyll_hyde-49"}
|
| 319 |
+
{"type": "setting", "entity": "cabinet", "text": "Lanyon directed to force open Jekyll's cabinet.", "source_chunk": "jekyll_hyde-49"}
|
| 320 |
+
{"type": "event", "entity": "Lanyon", "text": "Lanyon to retrieve specific items from Jekyll's cabinet.", "source_chunk": "jekyll_hyde-49"}
|
| 321 |
+
{"type": "location", "entity": "Cavendish Square", "text": "Drawer to be carried back to Cavendish Square exactly as it stands.", "source_chunk": "jekyll_hyde-50"}
|
| 322 |
+
{"type": "event", "entity": "Request", "text": "Request to be alone in consulting room at midnight.", "source_chunk": "jekyll_hyde-50"}
|
| 323 |
+
{"type": "rule", "entity": "Must", "text": "Must admit a man presenting himself in the name of the sender.", "source_chunk": "jekyll_hyde-50"}
|
| 324 |
+
{"type": "event", "entity": "Failure", "text": "Failure to follow arrangements could lead to death or shipwreck of reason.", "source_chunk": "jekyll_hyde-50"}
|
| 325 |
+
{"type": "organization", "entity": "post-office", "text": "Concern about the post-office failing to deliver the letter.", "source_chunk": "jekyll_hyde-50"}
|
| 326 |
+
{"type": "event", "entity": "Letter", "text": "Letter may not reach recipient until next morning.", "source_chunk": "jekyll_hyde-51"}
|
| 327 |
+
{"type": "event", "entity": "Henry Jekyll", "text": "If night passes without event, last seen of Henry Jekyll.", "source_chunk": "jekyll_hyde-51"}
|
| 328 |
+
{"type": "location", "entity": "Jekyll’s house", "text": "Colleague drove straight to Jekyll’s house.", "source_chunk": "jekyll_hyde-51"}
|
| 329 |
+
{"type": "organization", "entity": "Cavendish Square", "text": "Returned with drawer to Cavendish Square.", "source_chunk": "jekyll_hyde-51"}
|
| 330 |
+
{"type": "setting", "entity": "Dr. Denman’s surgical theatre", "text": "Private cabinet conveniently entered from Dr. Denman’s surgical theatre.", "source_chunk": "jekyll_hyde-51"}
|
| 331 |
+
{"type": "rule", "entity": "Colleague", "text": "Colleague felt bound to do as requested despite doubts.", "source_chunk": "jekyll_hyde-51"}
|
| 332 |
+
{"type": "event", "entity": "Butler", "text": "Butler received registered letter of instruction.", "source_chunk": "jekyll_hyde-51"}
|
| 333 |
+
{"type": "event", "entity": "Locksmith", "text": "Locksmith and carpenter called to assist with door.", "source_chunk": "jekyll_hyde-51"}
|
| 334 |
+
{"type": "event", "entity": "Door", "text": "Door opened after two hours of work.", "source_chunk": "jekyll_hyde-51"}
|
| 335 |
+
{"type": "event", "entity": "Contents", "text": "Contents of drawer examined, revealing private manufacture.", "source_chunk": "jekyll_hyde-51"}
|
| 336 |
+
{"type": "setting", "entity": "London", "text": "Twelve o’clock had scarce rung out over London", "source_chunk": "jekyll_hyde-52"}
|
| 337 |
+
{"type": "event", "entity": "arrival of messenger", "text": "knocker sounded very gently on the door", "source_chunk": "jekyll_hyde-52"}
|
| 338 |
+
{"type": "organization", "entity": "Dr. Jekyll", "text": "Are you come from Dr. Jekyll?", "source_chunk": "jekyll_hyde-52"}
|
| 339 |
+
{"type": "rule", "entity": null, "text": "received by me in secret", "source_chunk": "jekyll_hyde-52"}
|
| 340 |
+
{"type": "event", "entity": "cerebral disease", "text": "dealing with a case of cerebral disease", "source_chunk": "jekyll_hyde-52"}
|
| 341 |
+
{"type": "location", "entity": "portico", "text": "small man crouching against the pillars of the portico", "source_chunk": "jekyll_hyde-52"}
|
| 342 |
+
{"type": "event", "entity": "self-defence", "text": "loaded an old revolver, that I might be found in some posture of self-defence", "source_chunk": "jekyll_hyde-52"}
|
| 343 |
+
{"type": "event", "entity": "Visitor", "text": "Visitor enters consulting room after a searching glance into the darkness.", "source_chunk": "jekyll_hyde-53"}
|
| 344 |
+
{"type": "location", "entity": "consulting room", "text": "Bright light of the consulting room contrasts with the darkness of the square.", "source_chunk": "jekyll_hyde-53"}
|
| 345 |
+
{"type": "organization", "entity": "police", "text": "Policeman advancing with a bull’s eye open.", "source_chunk": "jekyll_hyde-53"}
|
| 346 |
+
{"type": "rule", "entity": "Presence", "text": "Presence of policeman causes visitor to start and make greater haste.", "source_chunk": "jekyll_hyde-53"}
|
| 347 |
+
{"type": "setting", "entity": "Atmosphere", "text": "Atmosphere described as having a marked sinking of the pulse and incipient rigour.", "source_chunk": "jekyll_hyde-53"}
|
| 348 |
+
{"type": "event", "entity": "Visitor", "text": "Visitor's appearance causes disgustful curiosity.", "source_chunk": "jekyll_hyde-53"}
|
| 349 |
+
{"type": "setting", "entity": "Visitor", "text": "Visitor's clothing is described as ludicrous and abnormal.", "source_chunk": "jekyll_hyde-53"}
|
| 350 |
+
{"type": "event", "entity": "Visitor", "text": "Visitor expresses impatience and urgency regarding a piece of business.", "source_chunk": "jekyll_hyde-54"}
|
| 351 |
+
{"type": "organization", "entity": "Dr. Henry Jekyll", "text": "Visitor comes at the instance of Dr. Henry Jekyll.", "source_chunk": "jekyll_hyde-54"}
|
| 352 |
+
{"type": "setting", "entity": "Interaction", "text": "Interaction occurs in a private space with a drawer covered by a sheet.", "source_chunk": "jekyll_hyde-54"}
|
| 353 |
+
{"type": "rule", "entity": "Politeness", "text": "Politeness is expected in social interactions, as noted by the visitor's apology.", "source_chunk": "jekyll_hyde-54"}
|
| 354 |
+
{"type": "event", "entity": "Visitor", "text": "Visitor experiences physical symptoms of anxiety and hysteria.", "source_chunk": "jekyll_hyde-54"}
|
| 355 |
+
{"type": "event", "entity": "Visitor", "text": "Visitor experiences immense relief upon uncovering the contents.", "source_chunk": "jekyll_hyde-55"}
|
| 356 |
+
{"type": "event", "entity": "Visitor", "text": "Visitor prepares a chemical mixture that changes color and effervesces.", "source_chunk": "jekyll_hyde-55"}
|
| 357 |
+
{"type": "rule", "entity": "Decision", "text": "Decision to allow visitor to leave with the glass or to pursue knowledge.", "source_chunk": "jekyll_hyde-55"}
|
| 358 |
+
{"type": "setting", "entity": "Interaction", "text": "Interaction occurs in a room with a table and a graduated glass.", "source_chunk": "jekyll_hyde-55"}
|
| 359 |
+
{"type": "organization", "entity": "Knowledge", "text": "Knowledge and power are presented as rewards for curiosity.", "source_chunk": "jekyll_hyde-55"}
|
| 360 |
+
{"type": "event", "entity": null, "text": "A visitor drinks from a glass, leading to a transformation.", "source_chunk": "jekyll_hyde-56"}
|
| 361 |
+
{"type": "event", "entity": "Henry Jekyll", "text": "Henry Jekyll appears transformed after the visitor drinks.", "source_chunk": "jekyll_hyde-56"}
|
| 362 |
+
{"type": "rule", "entity": "Vows", "text": "Vows are mentioned, indicating a code of conduct in a profession.", "source_chunk": "jekyll_hyde-56"}
|
| 363 |
+
{"type": "setting", "entity": "The", "text": "The scene takes place in a room.", "source_chunk": "jekyll_hyde-56"}
|
| 364 |
+
{"type": "location", "entity": null, "text": "A new province of knowledge is suggested to be accessible.", "source_chunk": "jekyll_hyde-56"}
|
| 365 |
+
{"type": "event", "entity": "The", "text": "The narrator experiences terror and disbelief after witnessing the transformation.", "source_chunk": "jekyll_hyde-56"}
|
| 366 |
+
{"type": "event", "entity": "Hyde", "text": "Hyde known as the murderer of Carew.", "source_chunk": "jekyll_hyde-57"}
|
| 367 |
+
{"type": "rule", "entity": "Moral", "text": "Moral turpitude causes horror and incredulity.", "source_chunk": "jekyll_hyde-57"}
|
| 368 |
+
{"type": "setting", "entity": "Deadliest", "text": "Deadliest terror present at all hours.", "source_chunk": "jekyll_hyde-57"}
|
| 369 |
+
{"type": "event", "entity": "Days", "text": "Days are numbered and death is imminent.", "source_chunk": "jekyll_hyde-57"}
|
| 370 |
+
{"type": "event", "entity": "Birth", "text": "Birth to a large fortune and excellent parts.", "source_chunk": "jekyll_hyde-58"}
|
| 371 |
+
{"type": "rule", "entity": "Concealment", "text": "Concealment of pleasures due to high aspirations.", "source_chunk": "jekyll_hyde-58"}
|
| 372 |
+
{"type": "setting", "entity": "Reflection", "text": "Reflection on progress and position in the world.", "source_chunk": "jekyll_hyde-58"}
|
| 373 |
+
{"type": "rule", "entity": "Morbid", "text": "Morbid sense of shame regarding faults.", "source_chunk": "jekyll_hyde-58"}
|
| 374 |
+
{"type": "event", "entity": "Commitment", "text": "Commitment to a profound duplicity of life.", "source_chunk": "jekyll_hyde-58"}
|
| 375 |
+
{"type": "rule", "entity": "Severance", "text": "Severance of good and ill within man's dual nature.", "source_chunk": "jekyll_hyde-58"}
|
| 376 |
+
{"type": "rule", "entity": "Reflection", "text": "Reflection on the hard law of life related to religion.", "source_chunk": "jekyll_hyde-58"}
|
| 377 |
+
{"type": "event", "entity": "Scientific", "text": "Scientific studies leading towards the mystic and transcendental.", "source_chunk": "jekyll_hyde-58"}
|
| 378 |
+
{"type": "event", "entity": "Discovery", "text": "Discovery of the duality of man leading to a moral and intellectual struggle.", "source_chunk": "jekyll_hyde-59"}
|
| 379 |
+
{"type": "rule", "entity": "Man", "text": "Man is not truly one, but truly two, representing a duality in nature.", "source_chunk": "jekyll_hyde-59"}
|
| 380 |
+
{"type": "setting", "entity": "Consciousness", "text": "Consciousness as a battleground for conflicting moral and intellectual natures.", "source_chunk": "jekyll_hyde-59"}
|
| 381 |
+
{"type": "concept", "entity": "Separation", "text": "Separation of moral and immoral identities to relieve life's burdens.", "source_chunk": "jekyll_hyde-59"}
|
| 382 |
+
{"type": "organization", "entity": "Future", "text": "Future scientific advancements will further explore the duality of man.", "source_chunk": "jekyll_hyde-59"}
|
| 383 |
+
{"type": "rule", "entity": "Doom", "text": "Doom and burden of life is bound for ever on man's shoulders.", "source_chunk": "jekyll_hyde-60"}
|
| 384 |
+
{"type": "event", "entity": "Attempt", "text": "Attempt to cast off life's burden returns with more pressure.", "source_chunk": "jekyll_hyde-60"}
|
| 385 |
+
{"type": "setting", "entity": "laboratory", "text": "Side light began to shine upon the subject from the laboratory table.", "source_chunk": "jekyll_hyde-60"}
|
| 386 |
+
{"type": "event", "entity": "Discovery", "text": "Discovery of a drug that controls identity.", "source_chunk": "jekyll_hyde-60"}
|
| 387 |
+
{"type": "rule", "entity": "Risk", "text": "Risk of death from drug that controls identity.", "source_chunk": "jekyll_hyde-60"}
|
| 388 |
+
{"type": "event", "entity": "Hesitation", "text": "Hesitation before testing the theory of identity change.", "source_chunk": "jekyll_hyde-60"}
|
| 389 |
+
{"type": "event", "entity": "Compounded", "text": "Compounded elements and drank potion leading to transformation.", "source_chunk": "jekyll_hyde-61"}
|
| 390 |
+
{"type": "setting", "entity": "Nighttime", "text": "Nighttime, with inmates locked in slumber.", "source_chunk": "jekyll_hyde-61"}
|
| 391 |
+
{"type": "rule", "entity": "Discovery", "text": "Discovery of a profound potion leads to a moral and physical transformation.", "source_chunk": "jekyll_hyde-61"}
|
| 392 |
+
{"type": "location", "entity": "Room", "text": "Room without a mirror, later brought for transformations.", "source_chunk": "jekyll_hyde-61"}
|
| 393 |
+
{"type": "event", "entity": "Experiencing", "text": "Experiencing sensations of youth, lightness, and wickedness after potion.", "source_chunk": "jekyll_hyde-61"}
|
| 394 |
+
{"type": "setting", "entity": "house", "text": "House was locked in rigorous hours of slumber.", "source_chunk": "jekyll_hyde-62"}
|
| 395 |
+
{"type": "event", "entity": "appearance of Edward Hyde", "text": "First time seeing the appearance of Edward Hyde.", "source_chunk": "jekyll_hyde-62"}
|
| 396 |
+
{"type": "rule", "entity": "Evil", "text": "Evil side of nature was less robust and developed than good side.", "source_chunk": "jekyll_hyde-62"}
|
| 397 |
+
{"type": "rule", "entity": "Evil", "text": "Evil is considered the lethal side of man.", "source_chunk": "jekyll_hyde-62"}
|
| 398 |
+
{"type": "location", "entity": "corridors", "text": "Stole through the corridors, feeling like a stranger in own house.", "source_chunk": "jekyll_hyde-62"}
|
| 399 |
+
{"type": "organization", "entity": "Human", "text": "Human beings are commingled out of good and evil.", "source_chunk": "jekyll_hyde-62"}
|
| 400 |
+
{"type": "event", "entity": "Wearing", "text": "Wearing semblance of Edward Hyde caused visible misgiving in others.", "source_chunk": "jekyll_hyde-62"}
|
| 401 |
+
{"type": "rule", "entity": "Human", "text": "Human beings are commingled out of good and evil.", "source_chunk": "jekyll_hyde-63"}
|
| 402 |
+
{"type": "event", "entity": "experiment", "text": "Conclusive experiment to determine loss of identity.", "source_chunk": "jekyll_hyde-63"}
|
| 403 |
+
{"type": "setting", "entity": "cabinet", "text": "Preparation and consumption of the transformative drug.", "source_chunk": "jekyll_hyde-63"}
|
| 404 |
+
{"type": "event", "entity": "cross-roads", "text": "Moment of decision regarding the nature of the experiment.", "source_chunk": "jekyll_hyde-63"}
|
| 405 |
+
{"type": "rule", "entity": "Drug", "text": "Drug has no discriminating action; it reveals true nature.", "source_chunk": "jekyll_hyde-63"}
|
| 406 |
+
{"type": "organization", "entity": "Philippi", "text": "Reference to captives of Philippi to illustrate transformation.", "source_chunk": "jekyll_hyde-63"}
|
| 407 |
+
{"type": "event", "entity": "new power", "text": "Temptation leading to moral decline.", "source_chunk": "jekyll_hyde-63"}
|
| 408 |
+
{"type": "setting", "entity": "Life", "text": "Life of study perceived as dry and unwelcome.", "source_chunk": "jekyll_hyde-63"}
|
| 409 |
+
{"type": "location", "entity": "Soho", "text": "Took and furnished that house in Soho, to which Hyde was tracked by the police.", "source_chunk": "jekyll_hyde-64"}
|
| 410 |
+
{"type": "event", "entity": "Drank", "text": "Drank the cup to doff the body of the noted professor and assume that of Edward Hyde.", "source_chunk": "jekyll_hyde-64"}
|
| 411 |
+
{"type": "organization", "entity": "police", "text": "Hyde was tracked by the police.", "source_chunk": "jekyll_hyde-64"}
|
| 412 |
+
{"type": "rule", "entity": "Drew", "text": "Drew up a will to enter on that of Edward Hyde without pecuniary loss.", "source_chunk": "jekyll_hyde-64"}
|
| 413 |
+
{"type": "event", "entity": "First", "text": "First to hire bravos for pleasures while maintaining public respectability.", "source_chunk": "jekyll_hyde-64"}
|
| 414 |
+
{"type": "setting", "entity": "Laboratory", "text": "Laboratory door where the draught was mixed and swallowed.", "source_chunk": "jekyll_hyde-64"}
|
| 415 |
+
{"type": "location", "entity": null, "text": "study", "source_chunk": "jekyll_hyde-65"}
|
| 416 |
+
{"type": "event", "entity": "Edward Hyde", "text": "acts of Edward Hyde centered on self and drinking pleasure with bestial avidity", "source_chunk": "jekyll_hyde-65"}
|
| 417 |
+
{"type": "rule", "entity": null, "text": "situation was apart from ordinary laws, insidiously relaxed the grasp of conscience", "source_chunk": "jekyll_hyde-65"}
|
| 418 |
+
{"type": "organization", "entity": "doctor", "text": "doctor and the child’s family joined in anger against Edward Hyde", "source_chunk": "jekyll_hyde-65"}
|
| 419 |
+
{"type": "event", "entity": null, "text": "act of cruelty to a child aroused anger of a passer-by", "source_chunk": "jekyll_hyde-65"}
|
| 420 |
+
{"type": "event", "entity": "Henry Jekyll", "text": "Edward Hyde paid in a cheque drawn in the name of Henry Jekyll", "source_chunk": "jekyll_hyde-65"}
|
| 421 |
+
{"type": "event", "entity": "Edward Hyde", "text": "Edward Hyde pacifies resentment by paying with a cheque drawn in the name of Henry Jekyll.", "source_chunk": "jekyll_hyde-66"}
|
| 422 |
+
{"type": "event", "entity": "Edward Hyde", "text": "Edward Hyde opens an account at another bank to eliminate future dangers.", "source_chunk": "jekyll_hyde-66"}
|
| 423 |
+
{"type": "setting", "entity": "Soho", "text": "Edward Hyde is accustomed to sleep in a little room in Soho.", "source_chunk": "jekyll_hyde-66"}
|
| 424 |
+
{"type": "setting", "entity": "mid-London", "text": "The scene takes place in mid-London during the morning.", "source_chunk": "jekyll_hyde-66"}
|
| 425 |
+
{"type": "rule", "entity": "Edward Hyde", "text": "Edward Hyde uses a signature supplied by Henry Jekyll to operate beyond the reach of fate.", "source_chunk": "jekyll_hyde-66"}
|
| 426 |
+
{"type": "event", "entity": "Sir Danvers", "text": "Murder of Sir Danvers occurs two months after the events described.", "source_chunk": "jekyll_hyde-66"}
|
| 427 |
+
{"type": "setting", "entity": "Henry Jekyll", "text": "Description of Henry Jekyll's hand as professional in shape and size.", "source_chunk": "jekyll_hyde-66"}
|
| 428 |
+
{"type": "setting", "entity": "Edward Hyde", "text": "Description of Edward Hyde's hand as lean, corded, knuckly, and dusky.", "source_chunk": "jekyll_hyde-66"}
|
| 429 |
+
{"type": "event", "entity": "transformation", "text": "Henry Jekyll awakens as Edward Hyde.", "source_chunk": "jekyll_hyde-67"}
|
| 430 |
+
{"type": "setting", "entity": "anatomical theatre", "text": "Location described as part of the journey to retrieve drugs.", "source_chunk": "jekyll_hyde-67"}
|
| 431 |
+
{"type": "rule", "entity": "Alteration", "text": "Alteration in stature cannot be concealed.", "source_chunk": "jekyll_hyde-67"}
|
| 432 |
+
{"type": "organization", "entity": "servants", "text": "Servants are accustomed to the coming and going of the second self.", "source_chunk": "jekyll_hyde-67"}
|
| 433 |
+
{"type": "event", "entity": "breakfast", "text": "Dr. Jekyll feigns breakfast after transformation.", "source_chunk": "jekyll_hyde-67"}
|
| 434 |
+
{"type": "rule", "entity": "Reflection", "text": "Reflection on the dangers of a double existence.", "source_chunk": "jekyll_hyde-67"}
|
| 435 |
+
{"type": "event", "entity": "danger", "text": "Concern about the balance of nature being permanently overthrown.", "source_chunk": "jekyll_hyde-67"}
|
| 436 |
+
{"type": "event", "entity": "Prolonged", "text": "Prolonged use of the drug risks permanent loss of original self.", "source_chunk": "jekyll_hyde-68"}
|
| 437 |
+
{"type": "rule", "entity": "Power", "text": "Power of voluntary change can be forfeited.", "source_chunk": "jekyll_hyde-68"}
|
| 438 |
+
{"type": "setting", "entity": "Edward Hyde", "text": "Character of Edward Hyde may become irrevocably dominant.", "source_chunk": "jekyll_hyde-68"}
|
| 439 |
+
{"type": "event", "entity": "Drug", "text": "Drug effectiveness has varied; early failure led to increased dosage.", "source_chunk": "jekyll_hyde-68"}
|
| 440 |
+
{"type": "rule", "entity": "Choice", "text": "Choice between two natures leads to loss of original self.", "source_chunk": "jekyll_hyde-68"}
|
| 441 |
+
{"type": "organization", "entity": "Jekyll", "text": "Jekyll represents the original self with sensitive apprehensions.", "source_chunk": "jekyll_hyde-68"}
|
| 442 |
+
{"type": "organization", "entity": "Hyde", "text": "Hyde represents the indulgent, indifferent side of the character.", "source_chunk": "jekyll_hyde-68"}
|
| 443 |
+
{"type": "event", "entity": "Choosing Jekyll", "text": "Choosing Jekyll means sacrificing indulgent appetites.", "source_chunk": "jekyll_hyde-68"}
|
| 444 |
+
{"type": "event", "entity": "Choosing Hyde", "text": "Choosing Hyde means losing interests and becoming friendless.", "source_chunk": "jekyll_hyde-68"}
|
| 445 |
+
{"type": "event", "entity": "Choice", "text": "Choice made between the life of Jekyll and Hyde.", "source_chunk": "jekyll_hyde-69"}
|
| 446 |
+
{"type": "rule", "entity": "Temptation", "text": "Temptation and moral struggle are common to humanity.", "source_chunk": "jekyll_hyde-69"}
|
| 447 |
+
{"type": "setting", "entity": "Soho", "text": "House in Soho remains as a reminder of Hyde.", "source_chunk": "jekyll_hyde-69"}
|
| 448 |
+
{"type": "event", "entity": "Two", "text": "Two months of strict adherence to a moral life.", "source_chunk": "jekyll_hyde-69"}
|
| 449 |
+
{"type": "event", "entity": "Return", "text": "Return to indulgence with the consumption of the transforming draught.", "source_chunk": "jekyll_hyde-69"}
|
| 450 |
+
{"type": "rule", "entity": "Moral", "text": "Moral insensibility leads to punishment.", "source_chunk": "jekyll_hyde-69"}
|
| 451 |
+
{"type": "organization", "entity": "conscience", "text": "Conscience initially provides approval but becomes routine.", "source_chunk": "jekyll_hyde-69"}
|
| 452 |
+
{"type": "rule", "entity": "Moral", "text": "Moral insensibility and readiness to evil are leading characters.", "source_chunk": "jekyll_hyde-70"}
|
| 453 |
+
{"type": "event", "entity": "Transformation", "text": "Transformation into Edward Hyde leads to violent behavior.", "source_chunk": "jekyll_hyde-70"}
|
| 454 |
+
{"type": "setting", "entity": "Soho", "text": "Scene of fleeing after committing a crime.", "source_chunk": "jekyll_hyde-70"}
|
| 455 |
+
{"type": "event", "entity": "Destruction", "text": "Destruction of papers to cover up actions.", "source_chunk": "jekyll_hyde-70"}
|
| 456 |
+
{"type": "event", "entity": "Gloating", "text": "Gloating over crime while fearing retribution.", "source_chunk": "jekyll_hyde-70"}
|
| 457 |
+
{"type": "rule", "entity": "Temptation", "text": "Temptation leads to inevitable moral failure.", "source_chunk": "jekyll_hyde-70"}
|
| 458 |
+
{"type": "event", "entity": "Pledge", "text": "Pledge made to the dead man during a moment of transformation.", "source_chunk": "jekyll_hyde-71"}
|
| 459 |
+
{"type": "event", "entity": "Henry Jekyll", "text": "Henry Jekyll falls to his knees in gratitude and remorse.", "source_chunk": "jekyll_hyde-71"}
|
| 460 |
+
{"type": "rule", "entity": "Self", "text": "Self-indulgence is renounced and replaced with humility and restrictions of natural life.", "source_chunk": "jekyll_hyde-71"}
|
| 461 |
+
{"type": "event", "entity": "News", "text": "News of a murder linked to Hyde, a man of public estimation.", "source_chunk": "jekyll_hyde-71"}
|
| 462 |
+
{"type": "location", "entity": "city of refuge", "text": "Jekyll serves as a refuge from Hyde.", "source_chunk": "jekyll_hyde-71"}
|
| 463 |
+
{"type": "event", "entity": "Resolve", "text": "Resolve to redeem the past and relieve suffering.", "source_chunk": "jekyll_hyde-71"}
|
| 464 |
+
{"type": "event", "entity": "Resolve", "text": "Resolve was fruitful of some good; laboured to relieve suffering.", "source_chunk": "jekyll_hyde-72"}
|
| 465 |
+
{"type": "setting", "entity": "Regent’s Park", "text": "Regent’s Park was full of winter chirrupings and sweet with spring odours.", "source_chunk": "jekyll_hyde-72"}
|
| 466 |
+
{"type": "rule", "entity": "Cursed", "text": "Cursed with duality of purpose; temptation to trifle with conscience.", "source_chunk": "jekyll_hyde-72"}
|
| 467 |
+
{"type": "event", "entity": "Fall", "text": "Fall seemed natural, like a return to old days before discovery.", "source_chunk": "jekyll_hyde-72"}
|
| 468 |
+
{"type": "event", "entity": "Comparison", "text": "Comparison with neighbours; active good-will versus lazy cruelty.", "source_chunk": "jekyll_hyde-72"}
|
| 469 |
+
{"type": "emotion", "entity": "Felt", "text": "Felt a horrid nausea and deadly shuddering.", "source_chunk": "jekyll_hyde-72"}
|
| 470 |
+
{"type": "event", "entity": "Transformation", "text": "Transformation from Jekyll to Hyde, leading to a change in thoughts and feelings.", "source_chunk": "jekyll_hyde-73"}
|
| 471 |
+
{"type": "setting", "entity": "Portland Street", "text": "Location where Hyde drives to an hotel.", "source_chunk": "jekyll_hyde-73"}
|
| 472 |
+
{"type": "rule", "entity": "Hyde", "text": "Hyde is a known murderer and hunted by mankind.", "source_chunk": "jekyll_hyde-73"}
|
| 473 |
+
{"type": "organization", "entity": "Lanyon", "text": "Thought of Lanyon as a means to access Jekyll's cabinet.", "source_chunk": "jekyll_hyde-73"}
|
| 474 |
+
{"type": "event", "entity": "Hyde", "text": "Hyde's struggle to obtain drugs from Jekyll's cabinet.", "source_chunk": "jekyll_hyde-73"}
|
| 475 |
+
{"type": "setting", "entity": "Hyde", "text": "Hyde's laboratory door is closed, preventing access.", "source_chunk": "jekyll_hyde-73"}
|
| 476 |
+
{"type": "rule", "entity": "Hyde", "text": "Hyde must employ another hand to retrieve the drugs.", "source_chunk": "jekyll_hyde-73"}
|
| 477 |
+
{"type": "location", "entity": "Portland Street", "text": "Hotel located in Portland Street.", "source_chunk": "jekyll_hyde-74"}
|
| 478 |
+
{"type": "setting", "entity": "Private", "text": "Private room in an inn where the character sat alone.", "source_chunk": "jekyll_hyde-74"}
|
| 479 |
+
{"type": "event", "entity": "Character", "text": "Character composed two important letters to Lanyon and Poole.", "source_chunk": "jekyll_hyde-74"}
|
| 480 |
+
{"type": "event", "entity": "Character", "text": "Character sat over the fire, gnawing nails, and dined alone.", "source_chunk": "jekyll_hyde-74"}
|
| 481 |
+
{"type": "event", "entity": "Character", "text": "Character discharged the cab and ventured on foot.", "source_chunk": "jekyll_hyde-74"}
|
| 482 |
+
{"type": "rule", "entity": "Character", "text": "Character's appearance caused attendants to tremble and act obsequiously.", "source_chunk": "jekyll_hyde-74"}
|
| 483 |
+
{"type": "event", "entity": "Character", "text": "Character felt fear and hatred, marked out for observation.", "source_chunk": "jekyll_hyde-74"}
|
| 484 |
+
{"type": "event", "entity": null, "text": "A woman offered a box of lights but was smote in the face.", "source_chunk": "jekyll_hyde-75"}
|
| 485 |
+
{"type": "event", "entity": "Lanyon", "text": "Condemnation received partly in a dream.", "source_chunk": "jekyll_hyde-75"}
|
| 486 |
+
{"type": "setting", "entity": "home", "text": "Character felt gratitude for escape while at home.", "source_chunk": "jekyll_hyde-75"}
|
| 487 |
+
{"type": "rule", "entity": "Character", "text": "Character experiences a change from fear of gallows to horror of being Hyde.", "source_chunk": "jekyll_hyde-75"}
|
| 488 |
+
{"type": "event", "entity": "Indescribable", "text": "Indescribable sensations heralded a change, leading to a return of Hyde.", "source_chunk": "jekyll_hyde-75"}
|
| 489 |
+
{"type": "rule", "entity": "Only", "text": "Only under stimulation of the drug could the character maintain the countenance of Jekyll.", "source_chunk": "jekyll_hyde-75"}
|
| 490 |
+
{"type": "event", "entity": "Transformation", "text": "Transformation into Hyde occurs during sleep or when the drug's effects wear off.", "source_chunk": "jekyll_hyde-76"}
|
| 491 |
+
{"type": "setting", "entity": "State", "text": "State of continuous impending doom and sleeplessness.", "source_chunk": "jekyll_hyde-76"}
|
| 492 |
+
{"type": "rule", "entity": "Strain", "text": "Strain of transformation leads to physical and mental weakness.", "source_chunk": "jekyll_hyde-76"}
|
| 493 |
+
{"type": "event", "entity": "Awakening", "text": "Awakening as Hyde after dozing or sleeping.", "source_chunk": "jekyll_hyde-76"}
|
| 494 |
+
{"type": "rule", "entity": "Hyde", "text": "Hyde's powers grow as Jekyll's health declines.", "source_chunk": "jekyll_hyde-76"}
|
| 495 |
+
{"type": "event", "entity": "Jekyll", "text": "Jekyll experiences distress from the duality of his existence.", "source_chunk": "jekyll_hyde-76"}
|
| 496 |
+
{"type": "rule", "entity": "Hyde", "text": "Hyde is perceived as hellish and inorganic.", "source_chunk": "jekyll_hyde-76"}
|
| 497 |
+
{"type": "setting", "entity": "Jekyll", "text": "Jekyll feels a close, caged connection to Hyde.", "source_chunk": "jekyll_hyde-76"}
|
| 498 |
+
{"type": "event", "entity": "Hatred", "text": "Hatred of Hyde for Jekyll drives him to commit temporary suicide.", "source_chunk": "jekyll_hyde-77"}
|
| 499 |
+
{"type": "event", "entity": "Hyde", "text": "Hyde plays tricks, scrawling blasphemies and destroying letters.", "source_chunk": "jekyll_hyde-77"}
|
| 500 |
+
{"type": "event", "entity": "Jekyll", "text": "Jekyll's punishment might have continued for years without the last calamity.", "source_chunk": "jekyll_hyde-77"}
|
| 501 |
+
{"type": "event", "entity": "Jekyll", "text": "Jekyll's supply of salt runs low, affecting his experiments.", "source_chunk": "jekyll_hyde-77"}
|
| 502 |
+
{"type": "location", "entity": "London", "text": "Jekyll has had London ransacked for supplies.", "source_chunk": "jekyll_hyde-77"}
|
| 503 |
+
{"type": "rule", "entity": "Fear", "text": "Fear of death drives Hyde's actions and loathing of necessity.", "source_chunk": "jekyll_hyde-77"}
|
| 504 |
+
{"type": "setting", "entity": "Jekyll", "text": "Jekyll experiences a callousness of soul and acquiescence of despair.", "source_chunk": "jekyll_hyde-77"}
|
| 505 |
+
{"type": "event", "entity": "Henry Jekyll", "text": "Henry Jekyll finishing statement under influence of old powders.", "source_chunk": "jekyll_hyde-78"}
|
| 506 |
+
{"type": "event", "entity": "Henry Jekyll", "text": "Henry Jekyll fears transformation into Hyde while writing.", "source_chunk": "jekyll_hyde-78"}
|
| 507 |
+
{"type": "setting", "entity": "Room", "text": "Room described as last earthly refuge.", "source_chunk": "jekyll_hyde-78"}
|
| 508 |
+
{"type": "rule", "entity": "Combination", "text": "Combination of great prudence and great good luck has preserved narrative.", "source_chunk": "jekyll_hyde-78"}
|
| 509 |
+
{"type": "event", "entity": "Henry Jekyll", "text": "Henry Jekyll anticipates his own death and transformation.", "source_chunk": "jekyll_hyde-78"}
|
| 510 |
+
{"type": "organization", "entity": "London", "text": "London ransacked in search of supplies.", "source_chunk": "jekyll_hyde-78"}
|
data/raw/The Strange Case of Dr. Jekyll and Mr. Hyde.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/raw/cinderella.txt
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The wife of a rich man fell sick, and as she felt that her end
|
| 2 |
+
was drawing near, she called her only daughter to her bedside and
|
| 3 |
+
said, dear child, be good and pious, and then the
|
| 4 |
+
good God will always protect you, and I will look down on you
|
| 5 |
+
from heaven and be near you. Thereupon she closed her eyes and
|
| 6 |
+
departed. Every day the maiden went out to her mother's grave,
|
| 7 |
+
and wept, and she remained pious and good. When winter came
|
| 8 |
+
the snow spread a white sheet over the grave, and by the time the
|
| 9 |
+
spring sun had drawn it off again, the man had taken another wife.
|
| 10 |
+
The woman had brought with her into the house two daughters,
|
| 11 |
+
who were beautiful and fair of face, but vile and black of heart.
|
| 12 |
+
Now began a bad time for the poor step-child. Is the stupid goose
|
| 13 |
+
to sit in the parlor with us, they said. He who wants to eat bread
|
| 14 |
+
must earn it. Out with the kitchen-wench. They took her pretty
|
| 15 |
+
clothes away from her, put an old grey bedgown on her, and gave
|
| 16 |
+
her wooden shoes. Just look at the proud princess, how decked
|
| 17 |
+
out she is, they cried, and laughed, and led her into the kitchen.
|
| 18 |
+
There she had to do hard work from morning till night, get up
|
| 19 |
+
before daybreak, carry water, light fires, cook and wash. Besides
|
| 20 |
+
this, the sisters did her every imaginable injury - they mocked her
|
| 21 |
+
and emptied her peas and lentils into the ashes, so that she was
|
| 22 |
+
forced to sit and pick them out again. In the evening when she had
|
| 23 |
+
worked till she was weary she had no bed to go to, but had to sleep
|
| 24 |
+
by the hearth in the cinders. And as on that account she always
|
| 25 |
+
looked dusty and dirty, they called her cinderella.
|
| 26 |
+
It happened that the father was once going to the fair, and he
|
| 27 |
+
asked his two step-daughters what he should bring back for them.
|
| 28 |
+
Beautiful dresses, said one, pearls and jewels, said the second.
|
| 29 |
+
And you, cinderella, said he, what will you have. Father
|
| 30 |
+
break off for me the first branch which knocks against your hat on
|
| 31 |
+
your way home. So he bought beautiful dresses, pearls and jewels
|
| 32 |
+
for his two step-daughters, and on his way home, as he was riding
|
| 33 |
+
through a green thicket, a hazel twig brushed against him and
|
| 34 |
+
knocked off his hat. Then he broke off the branch and took it with
|
| 35 |
+
him. When he reached home he gave his step-daughters the things
|
| 36 |
+
which they had wished for, and to cinderella he gave the branch
|
| 37 |
+
from the hazel-bush. Cinderella thanked him, went to her mother's
|
| 38 |
+
grave and planted the branch on it, and wept so much that the tears
|
| 39 |
+
fell down on it and watered it. And it grew and became a handsome
|
| 40 |
+
tree. Thrice a day cinderella went and sat beneath it, and wept and
|
| 41 |
+
prayed, and a little white bird always came on the tree, and if
|
| 42 |
+
cinderella expressed a wish, the bird threw down to her what she
|
| 43 |
+
had wished for.
|
| 44 |
+
It happened, however, that the king gave orders for a festival
|
| 45 |
+
which was to last three days, and to which all the beautiful young
|
| 46 |
+
girls in the country were invited, in order that his son might choose
|
| 47 |
+
himself a bride. When the two step-sisters heard that they too were
|
| 48 |
+
to appear among the number, they were delighted, called cinderella
|
| 49 |
+
and said, comb our hair for us, brush our shoes and fasten our
|
| 50 |
+
buckles, for we are going to the wedding at the king's palace.
|
| 51 |
+
Cinderella obeyed, but wept, because she too would have liked to
|
| 52 |
+
go with them to the dance, and begged her step-mother to allow
|
| 53 |
+
her to do so. You go, cinderella, said she, covered in dust and
|
| 54 |
+
dirt as you are, and would go to the festival. You have no clothes
|
| 55 |
+
and shoes, and yet would dance. As, however, cinderella went on
|
| 56 |
+
asking, the step-mother said at last, I have emptied a dish of
|
| 57 |
+
lentils into the ashes for you, if you have picked them out again in
|
| 58 |
+
two hours, you shall go with us. The maiden went through the
|
| 59 |
+
back-door into the garden, and called, you tame pigeons, you
|
| 60 |
+
turtle-doves, and all you birds beneath the sky, come and help me
|
| 61 |
+
to pick
|
| 62 |
+
the good into the pot,
|
| 63 |
+
the bad into the crop.
|
| 64 |
+
Then two white pigeons came in by the kitchen window, and
|
| 65 |
+
afterwards the turtle-doves, and at last all the birds beneath the
|
| 66 |
+
sky, came whirring and crowding in, and alighted amongst the ashes.
|
| 67 |
+
And the pigeons nodded with their heads and began pick, pick,
|
| 68 |
+
pick, pick, and the rest began also pick, pick, pick, pick, and
|
| 69 |
+
gathered all the good grains into the dish. Hardly had one hour
|
| 70 |
+
passed before they had finished, and all flew out again. Then the
|
| 71 |
+
girl took the dish to her step-mother, and was glad, and believed
|
| 72 |
+
that now she would be allowed to go with them to the festival.
|
| 73 |
+
But the step-mother said, no, cinderella, you have no clothes and
|
| 74 |
+
you can not dance. You would only be laughed at. And as
|
| 75 |
+
cinderella wept at this, the step-mother said, if you can pick two
|
| 76 |
+
dishes of lentils out of the ashes for me in one hour, you shall go
|
| 77 |
+
with us. And she thought to herself, that she most certainly
|
| 78 |
+
cannot do again. When the step-mother had emptied the two
|
| 79 |
+
dishes of lentils amongst the ashes, the maiden went through the
|
| 80 |
+
back-door into the garden and cried, you tame pigeons, you
|
| 81 |
+
turtle-doves, and all you birds beneath the sky, come and help me
|
| 82 |
+
to pick
|
| 83 |
+
the good into the pot,
|
| 84 |
+
the bad into the crop.
|
| 85 |
+
Then two white pigeons came in by the kitchen-window, and
|
| 86 |
+
afterwards the turtle-doves, and at length all the birds beneath the
|
| 87 |
+
sky, came whirring and crowding in, and alighted amongst the
|
| 88 |
+
ashes. And the doves nodded with their heads and began pick,
|
| 89 |
+
pick, pick, pick, and the others began also pick, pick, pick, pick,
|
| 90 |
+
and gathered all the good seeds into the dishes, and before half an
|
| 91 |
+
hour was over they had already finished, and all flew out again.
|
| 92 |
+
Then the maiden was delighted, and believed that she might now go
|
| 93 |
+
with them to the wedding. But the step-mother said, all this will
|
| 94 |
+
not help. You cannot go with us, for you have no clothes and can
|
| 95 |
+
not dance. We should be ashamed of you. On this she turned her
|
| 96 |
+
back on cinderella, and hurried away with her two proud daughters.
|
| 97 |
+
As no one was now at home, cinderella went to her mother's
|
| 98 |
+
grave beneath the hazel-tree, and cried -
|
| 99 |
+
shiver and quiver, little tree,
|
| 100 |
+
silver and gold throw down over me.
|
| 101 |
+
Then the bird threw a gold and silver dress down to her, and
|
| 102 |
+
slippers embroidered with silk and silver. She put on the dress
|
| 103 |
+
with all speed, and went to the wedding. Her step-sisters and the
|
| 104 |
+
step-mother however did not know her, and thought she must be a
|
| 105 |
+
foreign princess, for she looked so beautiful in the golden dress.
|
| 106 |
+
They never once thought of cinderella, and believed that she was
|
| 107 |
+
sitting at home in the dirt, picking lentils out of the ashes. The
|
| 108 |
+
prince approached her, took her by the hand and danced with her.
|
| 109 |
+
He would dance with no other maiden, and never let loose of her
|
| 110 |
+
hand, and if any one else came to invite her, he said, this is my
|
| 111 |
+
partner.
|
| 112 |
+
She danced till it was evening, and then she wanted to go home.
|
| 113 |
+
But the king's son said, I will go with you and bear you company,
|
| 114 |
+
for he wished to see to whom the beautiful maiden belonged.
|
| 115 |
+
She escaped from him, however, and sprang into the
|
| 116 |
+
pigeon-house. The king's son waited until her father came, and
|
| 117 |
+
then he told him that the unknown maiden had leapt into the
|
| 118 |
+
pigeon-house. The old man thought, can it be cinderella. And
|
| 119 |
+
they had to bring him an axe and a pickaxe that he might hew
|
| 120 |
+
the pigeon-house to pieces, but no one was inside it. And when they
|
| 121 |
+
got home cinderella lay in her dirty clothes among the ashes, and
|
| 122 |
+
a dim little oil-lamp was burning on the mantle-piece, for
|
| 123 |
+
cinderella had jumped quickly down from the back of the pigeon-house
|
| 124 |
+
and had run to the little hazel-tree, and there she had taken off
|
| 125 |
+
her beautiful clothes and laid them on the grave, and the bird had
|
| 126 |
+
taken them away again, and then she had seated herself in the
|
| 127 |
+
kitchen amongst the ashes in her grey gown.
|
| 128 |
+
Next day when the festival began afresh, and her parents and
|
| 129 |
+
the step-sisters had gone once more, cinderella went to the
|
| 130 |
+
hazel-tree and said -
|
| 131 |
+
shiver and quiver, my little tree,
|
| 132 |
+
silver and gold throw down over me.
|
| 133 |
+
Then the bird threw down a much more beautiful dress than on
|
| 134 |
+
the preceding day. And when cinderella appeared at the wedding
|
| 135 |
+
in this dress, every one was astonished at her beauty. The king's
|
| 136 |
+
son had waited until she came, and instantly took her by the hand
|
| 137 |
+
and danced with no one but her. When others came and invited
|
| 138 |
+
her, he said, this is my partner. When evening came she wished
|
| 139 |
+
to leave, and the king's son followed her and wanted to see into
|
| 140 |
+
which house she went. But she sprang away from him, and into
|
| 141 |
+
the garden behind the house. Therein stood a beautiful tall tree on
|
| 142 |
+
which hung the most magnificent pears. She clambered so nimbly
|
| 143 |
+
between the branches like a squirrel that the king's son did not
|
| 144 |
+
know where she was gone. He waited until her father came, and
|
| 145 |
+
said to him, the unknown maiden has escaped from me, and I
|
| 146 |
+
believe she has climbed up the pear-tree. The father thought,
|
| 147 |
+
can it be cinderella. And had an axe brought and cut the
|
| 148 |
+
tree down, but no one was on it. And when they got into the
|
| 149 |
+
kitchen, cinderella lay there among the ashes, as usual, for she
|
| 150 |
+
had jumped down on the other side of the tree, had taken the
|
| 151 |
+
beautiful dress to the bird on the little hazel-tree, and put on her
|
| 152 |
+
grey gown.
|
| 153 |
+
On the third day, when the parents and sisters had gone away,
|
| 154 |
+
cinderella went once more to her mother's grave and said to the
|
| 155 |
+
little tree -
|
| 156 |
+
shiver and quiver, my little tree,
|
| 157 |
+
silver and gold throw down over me.
|
| 158 |
+
And now the bird threw down to her a dress which was more
|
| 159 |
+
splendid and magnificent than any she had yet had, and the
|
| 160 |
+
slippers were golden. And when she went to the festival in the
|
| 161 |
+
dress, no one knew how to speak for astonishment. The king's son
|
| 162 |
+
danced with her only, and if any one invited her to dance, he said
|
| 163 |
+
this is my partner.
|
| 164 |
+
When evening came, cinderella wished to leave, and the king's
|
| 165 |
+
son was anxious to go with her, but she escaped from him so quickly
|
| 166 |
+
that he could not follow her. The king's son, however, had
|
| 167 |
+
employed a ruse, and had caused the whole staircase to be smeared
|
| 168 |
+
with pitch, and there, when she ran down, had the maiden's left
|
| 169 |
+
slipper remained stuck. The king's son picked it up, and it was
|
| 170 |
+
small and dainty, and all golden. Next morning, he went with it to
|
| 171 |
+
the father, and said to him, no one shall be my wife but she whose
|
| 172 |
+
foot this golden slipper fits. Then were the two sisters glad,
|
| 173 |
+
for they had pretty feet. The eldest went with the shoe into her
|
| 174 |
+
room and wanted to try it on, and her mother stood by. But she
|
| 175 |
+
could not get her big toe into it, and the shoe was too small for
|
| 176 |
+
her. Then her mother gave her a knife and said, cut the toe off,
|
| 177 |
+
when you are queen you will have no more need to go on foot. The
|
| 178 |
+
maiden cut the toe off, forced the foot into the shoe, swallowed
|
| 179 |
+
the pain, and went out to the king's son. Then he took her on his
|
| 180 |
+
his horse as his bride and rode away with her. They were
|
| 181 |
+
obliged, however, to pass the grave, and there, on the hazel-tree,
|
| 182 |
+
sat the two pigeons and cried -
|
| 183 |
+
turn and peep, turn and peep,
|
| 184 |
+
there's blood within the shoe,
|
| 185 |
+
the shoe it is too small for her,
|
| 186 |
+
the true bride waits for you.
|
| 187 |
+
Then he looked at her foot and saw how the blood was trickling
|
| 188 |
+
from it. He turned his horse round and took the false bride
|
| 189 |
+
home again, and said she was not the true one, and that the
|
| 190 |
+
other sister was to put the shoe on. Then this one went into her
|
| 191 |
+
chamber and got her toes safely into the shoe, but her heel was
|
| 192 |
+
too large. So her mother gave her a knife and said, cut a bit
|
| 193 |
+
off your heel, when you are queen you will have no more need
|
| 194 |
+
to go on foot. The maiden cut a bit off her heel, forced
|
| 195 |
+
her foot into the shoe, swallowed the pain, and went out to the
|
| 196 |
+
king's son. He took her on his horse as his bride, and rode away
|
| 197 |
+
with her, but when they passed by the hazel-tree, the two pigeons
|
| 198 |
+
sat on it and cried -
|
| 199 |
+
turn and peep, turn and peep,
|
| 200 |
+
there's blood within the shoe,
|
| 201 |
+
the shoe it is too small for her,
|
| 202 |
+
the true bride waits for you.
|
| 203 |
+
He looked down at her foot and saw how the blood was running
|
| 204 |
+
out of her shoe, and how it had stained her white stocking quite
|
| 205 |
+
red. Then he turned his horse and took the false bride home
|
| 206 |
+
again. This also is not the right one, said he, have you no
|
| 207 |
+
other daughter. No, said the man, there is still a little
|
| 208 |
+
stunted kitchen-wench which my late wife left behind her, but
|
| 209 |
+
she cannot possibly be the bride. The king's son said he was
|
| 210 |
+
to send her up to him, but the mother answered, oh, no, she is
|
| 211 |
+
much too dirty, she cannot show herself. But he absolutely
|
| 212 |
+
insisted on it, and cinderella had to be called. She first
|
| 213 |
+
washed her hands and face clean, and then went and bowed down
|
| 214 |
+
before the king's son, who gave her the golden shoe. Then she
|
| 215 |
+
seated herself on a stool, drew her foot out of the heavy
|
| 216 |
+
wooden shoe, and put it into the slipper, which fitted like a
|
| 217 |
+
glove. And when she rose up and the king's son looked at her
|
| 218 |
+
face he recognized the beautiful maiden who had danced with
|
| 219 |
+
him and cried, that is the true bride. The step-mother and
|
| 220 |
+
the two sisters were horrified and became pale with rage, he,
|
| 221 |
+
however, took cinderella on his horse and rode away with her. As
|
| 222 |
+
they passed by the hazel-tree, the two white doves cried -
|
| 223 |
+
turn and peep, turn and peep,
|
| 224 |
+
no blood is in the shoe,
|
| 225 |
+
the shoe is not too small for her,
|
| 226 |
+
the true bride rides with you,
|
| 227 |
+
and when they had cried that, the two came flying down and
|
| 228 |
+
placed themselves on cinderella's shoulders, one on the right,
|
| 229 |
+
the other on the left, and remained sitting there.
|
| 230 |
+
When the wedding with the king's son was to be celebrated, the
|
| 231 |
+
two false sisters came and wanted to get into favor with
|
| 232 |
+
cinderella and share her good fortune. When the betrothed
|
| 233 |
+
couple went to church, the elder was at the right side and the
|
| 234 |
+
younger at the left, and the pigeons pecked out one eye from
|
| 235 |
+
each of them. Afterwards as they came back the elder was at
|
| 236 |
+
the left, and the younger at the right, and then the pigeons
|
| 237 |
+
pecked out the other eye from each. And thus, for their
|
| 238 |
+
wickedness and falsehood, they were punished with blindness
|
| 239 |
+
all their days.
|
pyproject.toml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[build-system]
|
| 2 |
+
requires = ["setuptools>=61.0", "wheel"]
|
| 3 |
+
build-backend = "setuptools.build_meta"
|
| 4 |
+
|
| 5 |
+
[project]
|
| 6 |
+
name = "fic-agent"
|
| 7 |
+
version = "0.0.1"
|
| 8 |
+
description = "No-finetune fiction character agent"
|
| 9 |
+
readme = "README.md"
|
| 10 |
+
requires-python = ">=3.9"
|
| 11 |
+
dependencies = [
|
| 12 |
+
"openai>=1.0.0",
|
| 13 |
+
"pydantic>=2.0.0",
|
| 14 |
+
"numpy>=1.24.0",
|
| 15 |
+
"tiktoken>=0.5.0",
|
| 16 |
+
"pandas>=2.0.0",
|
| 17 |
+
"faiss-cpu>=1.7.4",
|
| 18 |
+
]
|
| 19 |
+
|
| 20 |
+
[tool.setuptools]
|
| 21 |
+
package-dir = {"" = "src"}
|
| 22 |
+
|
| 23 |
+
[tool.setuptools.packages.find]
|
| 24 |
+
where = ["src"]
|
scripts/build_indexes.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Build vector indexes for facts, persona, and worldview."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import argparse
|
| 6 |
+
import json
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
from fic_agent.config import RuntimeConfig
|
| 10 |
+
from fic_agent.retrieval.retriever import build_index_for_texts
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def _load_jsonl(path: str):
|
| 14 |
+
rows = []
|
| 15 |
+
with open(path, "r", encoding="utf-8") as f:
|
| 16 |
+
for line in f:
|
| 17 |
+
line = line.strip()
|
| 18 |
+
if not line:
|
| 19 |
+
continue
|
| 20 |
+
rows.append(json.loads(line))
|
| 21 |
+
return rows
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def main() -> None:
|
| 25 |
+
parser = argparse.ArgumentParser(description="Build faiss indexes")
|
| 26 |
+
parser.add_argument("--processed-dir", default=None, help="Processed data directory")
|
| 27 |
+
args = parser.parse_args()
|
| 28 |
+
|
| 29 |
+
cfg = RuntimeConfig()
|
| 30 |
+
processed_dir = Path(args.processed_dir or cfg.data_processed_dir)
|
| 31 |
+
|
| 32 |
+
# Facts
|
| 33 |
+
chunks = _load_jsonl(str(processed_dir / "chunks.jsonl"))
|
| 34 |
+
fact_texts = [c["text"] for c in chunks]
|
| 35 |
+
fact_meta = [{"id": c["chunk_id"], "text": c["text"], "chapter_id": c["chapter_id"]} for c in chunks]
|
| 36 |
+
build_index_for_texts(fact_texts, fact_meta, cfg, "facts")
|
| 37 |
+
|
| 38 |
+
# Persona (all dialogues)
|
| 39 |
+
dialogues = _load_jsonl(str(processed_dir / "dialogues.jsonl"))
|
| 40 |
+
persona_texts = [d["utterance"] for d in dialogues]
|
| 41 |
+
persona_meta = [
|
| 42 |
+
{
|
| 43 |
+
"id": f"dlg-{i}",
|
| 44 |
+
"text": d["utterance"],
|
| 45 |
+
"speaker": d.get("speaker"),
|
| 46 |
+
"chunk_id": d.get("chunk_id"),
|
| 47 |
+
}
|
| 48 |
+
for i, d in enumerate(dialogues)
|
| 49 |
+
]
|
| 50 |
+
build_index_for_texts(persona_texts, persona_meta, cfg, "persona")
|
| 51 |
+
|
| 52 |
+
# Worldview
|
| 53 |
+
worldview = _load_jsonl(str(processed_dir / "worldview_notes.jsonl"))
|
| 54 |
+
worldview_texts = [w["text"] for w in worldview]
|
| 55 |
+
worldview_meta = [
|
| 56 |
+
{
|
| 57 |
+
"id": f"wv-{i}",
|
| 58 |
+
"text": w["text"],
|
| 59 |
+
"type": w.get("type"),
|
| 60 |
+
"entity": w.get("entity"),
|
| 61 |
+
"source_chunk": w.get("source_chunk"),
|
| 62 |
+
}
|
| 63 |
+
for i, w in enumerate(worldview)
|
| 64 |
+
]
|
| 65 |
+
build_index_for_texts(worldview_texts, worldview_meta, cfg, "worldview")
|
| 66 |
+
|
| 67 |
+
print("Indexes built in", cfg.data_index_dir)
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
if __name__ == "__main__":
|
| 71 |
+
main()
|
scripts/eval_answer.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Evaluate one generated answer with proxy factual/style/worldview scores."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import argparse
|
| 6 |
+
import json
|
| 7 |
+
|
| 8 |
+
from fic_agent.eval.judge import score_response
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def _load_json(path: str):
|
| 12 |
+
with open(path, "r", encoding="utf-8") as f:
|
| 13 |
+
return json.load(f)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
def main() -> None:
|
| 17 |
+
parser = argparse.ArgumentParser(description="Evaluate generated answer")
|
| 18 |
+
parser.add_argument("--result-json", required=True, help="Path produced by run_meta_qa --save-json")
|
| 19 |
+
parser.add_argument("--character", default=None, help="Character override")
|
| 20 |
+
parser.add_argument("--processed-dir", default="data/processed", help="Processed directory")
|
| 21 |
+
args = parser.parse_args()
|
| 22 |
+
|
| 23 |
+
obj = _load_json(args.result_json)
|
| 24 |
+
response = obj.get("answer", "")
|
| 25 |
+
evidence = obj.get("evidence", {})
|
| 26 |
+
character = args.character or obj.get("character")
|
| 27 |
+
|
| 28 |
+
scores = score_response(
|
| 29 |
+
response=response,
|
| 30 |
+
evidence=evidence,
|
| 31 |
+
character=character,
|
| 32 |
+
processed_dir=args.processed_dir,
|
| 33 |
+
)
|
| 34 |
+
print(json.dumps(scores, ensure_ascii=False, indent=2))
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
if __name__ == "__main__":
|
| 38 |
+
main()
|
scripts/run_meta_qa.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Run meta-cognitive QA loop end-to-end."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import argparse
|
| 6 |
+
import json
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
from fic_agent.config import RuntimeConfig
|
| 10 |
+
from fic_agent.generation.meta_loop import run_meta_cognitive_qa
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def main() -> None:
|
| 14 |
+
parser = argparse.ArgumentParser(description="fic-agent meta-cognitive QA")
|
| 15 |
+
parser.add_argument("--query", required=True, help="User question")
|
| 16 |
+
parser.add_argument("--character", default=None, help="Target character")
|
| 17 |
+
parser.add_argument("--max-iter", type=int, default=None, help="Max retrieval loops")
|
| 18 |
+
parser.add_argument("--style-correct", action="store_true", help="Apply style-only rewrite pass")
|
| 19 |
+
parser.add_argument("--dump-evidence", action="store_true", help="Print merged evidence pool")
|
| 20 |
+
parser.add_argument("--dump-trace", action="store_true", help="Print loop trace")
|
| 21 |
+
parser.add_argument("--save-json", default=None, help="Optional output json path")
|
| 22 |
+
args = parser.parse_args()
|
| 23 |
+
|
| 24 |
+
cfg = RuntimeConfig()
|
| 25 |
+
result = run_meta_cognitive_qa(
|
| 26 |
+
query=args.query,
|
| 27 |
+
cfg=cfg,
|
| 28 |
+
character=args.character,
|
| 29 |
+
style_correct=args.style_correct,
|
| 30 |
+
max_iterations=args.max_iter,
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
print("=== FINAL ANSWER ===")
|
| 34 |
+
print(result.answer)
|
| 35 |
+
|
| 36 |
+
if args.dump_trace:
|
| 37 |
+
print("\n=== LOOP TRACE ===")
|
| 38 |
+
for s in result.trace:
|
| 39 |
+
print(
|
| 40 |
+
f"iter={s.iteration} sufficient={s.sufficient} conf={s.confidence:.2f} "
|
| 41 |
+
f"probe={s.probe!r} missing={s.missing}"
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
if args.dump_evidence:
|
| 45 |
+
print("\n=== EVIDENCE POOL ===")
|
| 46 |
+
print(json.dumps(result.evidence, ensure_ascii=False, indent=2))
|
| 47 |
+
|
| 48 |
+
if args.save_json:
|
| 49 |
+
out = {
|
| 50 |
+
"query": args.query,
|
| 51 |
+
"character": args.character,
|
| 52 |
+
"answer": result.answer,
|
| 53 |
+
"trace": [s.__dict__ for s in result.trace],
|
| 54 |
+
"evidence": result.evidence,
|
| 55 |
+
}
|
| 56 |
+
path = Path(args.save_json)
|
| 57 |
+
path.parent.mkdir(parents=True, exist_ok=True)
|
| 58 |
+
path.write_text(json.dumps(out, ensure_ascii=False, indent=2), encoding="utf-8")
|
| 59 |
+
print(f"\nSaved json to {path}")
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
if __name__ == "__main__":
|
| 63 |
+
main()
|
scripts/run_pipeline.py
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Run the end-to-end pipeline (document/persona/worldview layers)."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import argparse
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
import re
|
| 8 |
+
from typing import Dict, List
|
| 9 |
+
|
| 10 |
+
from fic_agent.config import RuntimeConfig
|
| 11 |
+
from fic_agent.ingest.pipeline import (
|
| 12 |
+
build_document_layer,
|
| 13 |
+
chunks_to_dicts,
|
| 14 |
+
dialogues_to_dicts,
|
| 15 |
+
extract_dialogue,
|
| 16 |
+
load_text_file,
|
| 17 |
+
save_jsonl,
|
| 18 |
+
)
|
| 19 |
+
from fic_agent.persona.profile import (
|
| 20 |
+
build_persona_profile,
|
| 21 |
+
render_persona_prompt,
|
| 22 |
+
save_persona_profile,
|
| 23 |
+
save_persona_prompt,
|
| 24 |
+
)
|
| 25 |
+
from fic_agent.worldview.worldview import (
|
| 26 |
+
build_worldview_notes,
|
| 27 |
+
build_worldview_notes_llm,
|
| 28 |
+
save_worldview_notes,
|
| 29 |
+
)
|
| 30 |
+
from fic_agent.retrieval.retriever import build_index_for_texts
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def _norm_text(value: str) -> str:
|
| 34 |
+
return re.sub(r"\s+", " ", (value or "").strip()).lower()
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def _select_worldview_for_character(
|
| 38 |
+
character: str,
|
| 39 |
+
worldview_notes: List[Dict],
|
| 40 |
+
character_chunk_ids: set[str],
|
| 41 |
+
top_n: int = 6,
|
| 42 |
+
) -> List[str]:
|
| 43 |
+
char_tokens = set(_norm_text(character).split())
|
| 44 |
+
ranked: List[tuple[int, str]] = []
|
| 45 |
+
|
| 46 |
+
for note in worldview_notes:
|
| 47 |
+
text = (note.get("text") or "").strip()
|
| 48 |
+
if not text:
|
| 49 |
+
continue
|
| 50 |
+
entity = _norm_text(str(note.get("entity") or ""))
|
| 51 |
+
text_l = _norm_text(text)
|
| 52 |
+
source_chunk = note.get("source_chunk")
|
| 53 |
+
|
| 54 |
+
score = 0
|
| 55 |
+
if source_chunk in character_chunk_ids:
|
| 56 |
+
score += 2
|
| 57 |
+
if entity and char_tokens and (set(entity.split()) & char_tokens):
|
| 58 |
+
score += 4
|
| 59 |
+
if char_tokens and any(re.search(rf"\b{re.escape(tok)}\b", text_l) for tok in char_tokens):
|
| 60 |
+
score += 3
|
| 61 |
+
if note.get("type") in {"rule", "event"} and source_chunk in character_chunk_ids:
|
| 62 |
+
score += 1
|
| 63 |
+
if score > 0:
|
| 64 |
+
ranked.append((score, text))
|
| 65 |
+
|
| 66 |
+
ranked.sort(key=lambda x: (x[0], len(x[1])), reverse=True)
|
| 67 |
+
selected: List[str] = []
|
| 68 |
+
seen = set()
|
| 69 |
+
for _, text in ranked:
|
| 70 |
+
k = _norm_text(text)
|
| 71 |
+
if k in seen:
|
| 72 |
+
continue
|
| 73 |
+
seen.add(k)
|
| 74 |
+
selected.append(text)
|
| 75 |
+
if len(selected) >= top_n:
|
| 76 |
+
break
|
| 77 |
+
if selected:
|
| 78 |
+
return selected
|
| 79 |
+
|
| 80 |
+
# Fallback: provide a small set of global rule/setting notes.
|
| 81 |
+
for note in worldview_notes:
|
| 82 |
+
t = (note.get("type") or "").lower()
|
| 83 |
+
if t not in {"rule", "setting", "event", "location", "organization"}:
|
| 84 |
+
continue
|
| 85 |
+
text = (note.get("text") or "").strip()
|
| 86 |
+
if not text:
|
| 87 |
+
continue
|
| 88 |
+
k = _norm_text(text)
|
| 89 |
+
if k in seen:
|
| 90 |
+
continue
|
| 91 |
+
seen.add(k)
|
| 92 |
+
selected.append(text)
|
| 93 |
+
if len(selected) >= min(3, top_n):
|
| 94 |
+
break
|
| 95 |
+
return selected
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
def main() -> None:
|
| 99 |
+
parser = argparse.ArgumentParser(description="fic-agent pipeline")
|
| 100 |
+
parser.add_argument("--input", required=True, help="Path to raw novel text")
|
| 101 |
+
parser.add_argument("--book-id", default="book", help="Book id")
|
| 102 |
+
parser.add_argument("--character", default=None, help="Character name for persona")
|
| 103 |
+
parser.add_argument("--characters", default=None, help="Comma-separated character list for speaker detection")
|
| 104 |
+
parser.add_argument(
|
| 105 |
+
"--all-characters",
|
| 106 |
+
action="store_true",
|
| 107 |
+
help="Generate persona/profile prompt for all characters in --characters (or all detected speakers if --characters is absent).",
|
| 108 |
+
)
|
| 109 |
+
parser.add_argument("--max-chars", type=int, default=2000)
|
| 110 |
+
parser.add_argument("--overlap", type=int, default=200)
|
| 111 |
+
parser.add_argument("--build-index", action="store_true", help="Build vector indexes")
|
| 112 |
+
parser.add_argument("--worldview-llm", action="store_true", help="Use LLM to extract worldview notes")
|
| 113 |
+
args = parser.parse_args()
|
| 114 |
+
|
| 115 |
+
cfg = RuntimeConfig()
|
| 116 |
+
|
| 117 |
+
raw_text = load_text_file(args.input)
|
| 118 |
+
chunks = build_document_layer(raw_text, book_id=args.book_id, max_chars=args.max_chars, overlap=args.overlap)
|
| 119 |
+
chunk_dicts = chunks_to_dicts(chunks)
|
| 120 |
+
|
| 121 |
+
processed_dir = Path(cfg.data_processed_dir)
|
| 122 |
+
processed_dir.mkdir(parents=True, exist_ok=True)
|
| 123 |
+
|
| 124 |
+
chunks_path = processed_dir / "chunks.jsonl"
|
| 125 |
+
save_jsonl(chunk_dicts, str(chunks_path))
|
| 126 |
+
|
| 127 |
+
character_candidates = None
|
| 128 |
+
if args.characters:
|
| 129 |
+
character_candidates = [c.strip() for c in args.characters.split(",") if c.strip()]
|
| 130 |
+
|
| 131 |
+
dialogues = extract_dialogue(chunks, cfg=cfg, character_candidates=character_candidates)
|
| 132 |
+
dialogues_path = processed_dir / "dialogues.jsonl"
|
| 133 |
+
save_jsonl(dialogues_to_dicts(dialogues), str(dialogues_path))
|
| 134 |
+
|
| 135 |
+
# Worldview notes
|
| 136 |
+
if args.worldview_llm:
|
| 137 |
+
worldview_notes = build_worldview_notes_llm(chunk_dicts, cfg)
|
| 138 |
+
else:
|
| 139 |
+
worldview_notes = build_worldview_notes(chunk_dicts)
|
| 140 |
+
worldview_path = processed_dir / "worldview_notes.jsonl"
|
| 141 |
+
save_worldview_notes(worldview_notes, str(worldview_path))
|
| 142 |
+
|
| 143 |
+
# Persona profile(s)
|
| 144 |
+
persona_outputs: List[tuple[str, Path, Path]] = []
|
| 145 |
+
persona_targets: List[str] = []
|
| 146 |
+
if args.all_characters:
|
| 147 |
+
if character_candidates:
|
| 148 |
+
persona_targets = character_candidates
|
| 149 |
+
else:
|
| 150 |
+
# Derive from extracted speakers when candidates are not provided.
|
| 151 |
+
seen = set()
|
| 152 |
+
for d in dialogues:
|
| 153 |
+
if d.speaker and d.speaker not in seen:
|
| 154 |
+
seen.add(d.speaker)
|
| 155 |
+
persona_targets.append(d.speaker)
|
| 156 |
+
elif args.character:
|
| 157 |
+
persona_targets = [args.character]
|
| 158 |
+
|
| 159 |
+
for character in persona_targets:
|
| 160 |
+
utterances: List[str] = [d.utterance for d in dialogues if d.speaker == character]
|
| 161 |
+
background_utterances: List[str] = [d.utterance for d in dialogues if d.speaker != character]
|
| 162 |
+
character_chunk_ids = {d.chunk_id for d in dialogues if d.speaker == character}
|
| 163 |
+
all_speakers = sorted({d.speaker for d in dialogues if d.speaker})
|
| 164 |
+
excluded_terms = sorted(set((character_candidates or []) + all_speakers))
|
| 165 |
+
character_worldview_notes = _select_worldview_for_character(
|
| 166 |
+
character=character,
|
| 167 |
+
worldview_notes=worldview_notes,
|
| 168 |
+
character_chunk_ids=character_chunk_ids,
|
| 169 |
+
top_n=6,
|
| 170 |
+
)
|
| 171 |
+
profile = build_persona_profile(
|
| 172 |
+
character,
|
| 173 |
+
utterances,
|
| 174 |
+
background_utterances=background_utterances,
|
| 175 |
+
excluded_terms=excluded_terms,
|
| 176 |
+
worldview_notes=character_worldview_notes,
|
| 177 |
+
)
|
| 178 |
+
safe_character = character.replace("/", "_")
|
| 179 |
+
persona_path = processed_dir / f"persona_{safe_character}.json"
|
| 180 |
+
save_persona_profile(profile, str(persona_path))
|
| 181 |
+
persona_prompt_path = processed_dir / f"persona_{safe_character}_prompt.txt"
|
| 182 |
+
save_persona_prompt(render_persona_prompt(profile), str(persona_prompt_path))
|
| 183 |
+
persona_outputs.append((character, persona_path, persona_prompt_path))
|
| 184 |
+
|
| 185 |
+
print(f"Saved chunks to {chunks_path}")
|
| 186 |
+
print(f"Saved dialogues to {dialogues_path}")
|
| 187 |
+
for character, persona_path, persona_prompt_path in persona_outputs:
|
| 188 |
+
print(f"Saved persona for {character} to {persona_path}")
|
| 189 |
+
print(f"Saved persona prompt for {character} to {persona_prompt_path}")
|
| 190 |
+
print(f"Saved worldview notes to {worldview_path}")
|
| 191 |
+
|
| 192 |
+
if args.build_index:
|
| 193 |
+
# Facts
|
| 194 |
+
build_index_for_texts(
|
| 195 |
+
[c["text"] for c in chunk_dicts],
|
| 196 |
+
[
|
| 197 |
+
{"id": c["chunk_id"], "text": c["text"], "chapter_id": c["chapter_id"]}
|
| 198 |
+
for c in chunk_dicts
|
| 199 |
+
],
|
| 200 |
+
cfg,
|
| 201 |
+
"facts",
|
| 202 |
+
)
|
| 203 |
+
# Persona
|
| 204 |
+
if dialogues:
|
| 205 |
+
build_index_for_texts(
|
| 206 |
+
[d.utterance for d in dialogues],
|
| 207 |
+
[
|
| 208 |
+
{
|
| 209 |
+
"id": f"dlg-{i}",
|
| 210 |
+
"text": d.utterance,
|
| 211 |
+
"speaker": d.speaker,
|
| 212 |
+
"chunk_id": d.chunk_id,
|
| 213 |
+
}
|
| 214 |
+
for i, d in enumerate(dialogues)
|
| 215 |
+
],
|
| 216 |
+
cfg,
|
| 217 |
+
"persona",
|
| 218 |
+
)
|
| 219 |
+
else:
|
| 220 |
+
print("No dialogue extracted; skipping persona index.")
|
| 221 |
+
# Worldview
|
| 222 |
+
if worldview_notes:
|
| 223 |
+
build_index_for_texts(
|
| 224 |
+
[w["text"] for w in worldview_notes],
|
| 225 |
+
[
|
| 226 |
+
{
|
| 227 |
+
"id": f"wv-{i}",
|
| 228 |
+
"text": w["text"],
|
| 229 |
+
"type": w.get("type"),
|
| 230 |
+
"entity": w.get("entity"),
|
| 231 |
+
"source_chunk": w.get("source_chunk"),
|
| 232 |
+
}
|
| 233 |
+
for i, w in enumerate(worldview_notes)
|
| 234 |
+
],
|
| 235 |
+
cfg,
|
| 236 |
+
"worldview",
|
| 237 |
+
)
|
| 238 |
+
else:
|
| 239 |
+
print("No worldview notes extracted; skipping worldview index.")
|
| 240 |
+
print("Built faiss indexes in", cfg.data_index_dir)
|
| 241 |
+
|
| 242 |
+
|
| 243 |
+
if __name__ == "__main__":
|
| 244 |
+
main()
|
scripts/run_retrieve_compose.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Run tri-retrieve + fact-first persona-biased fusion."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import argparse
|
| 6 |
+
import json
|
| 7 |
+
|
| 8 |
+
from fic_agent.config import RuntimeConfig
|
| 9 |
+
from fic_agent.generation.compose import run_tri_retrieve_and_compose
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def main() -> None:
|
| 13 |
+
parser = argparse.ArgumentParser(description="fic-agent tri-retrieve + compose")
|
| 14 |
+
parser.add_argument("--query", required=True, help="User query")
|
| 15 |
+
parser.add_argument("--character", default=None, help="Target character name")
|
| 16 |
+
parser.add_argument("--style-correct", action="store_true", help="Apply style-only second pass")
|
| 17 |
+
parser.add_argument("--dump-evidence", action="store_true", help="Print retrieved evidence JSON")
|
| 18 |
+
args = parser.parse_args()
|
| 19 |
+
|
| 20 |
+
cfg = RuntimeConfig()
|
| 21 |
+
result = run_tri_retrieve_and_compose(
|
| 22 |
+
query=args.query,
|
| 23 |
+
cfg=cfg,
|
| 24 |
+
character=args.character,
|
| 25 |
+
style_correct=args.style_correct,
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
print("=== ANSWER ===")
|
| 29 |
+
print(result.answer)
|
| 30 |
+
if args.dump_evidence:
|
| 31 |
+
print("\n=== EVIDENCE ===")
|
| 32 |
+
print(json.dumps(result.evidence, ensure_ascii=False, indent=2))
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
if __name__ == "__main__":
|
| 36 |
+
main()
|
scripts/upload_to_hf.sh
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
usage() {
|
| 5 |
+
cat <<'EOF'
|
| 6 |
+
Usage:
|
| 7 |
+
bash scripts/upload_to_hf.sh [options]
|
| 8 |
+
|
| 9 |
+
Options:
|
| 10 |
+
--repo NAME Repo name on Hugging Face (default: fic-agent)
|
| 11 |
+
--type TYPE model | dataset | space (default: dataset)
|
| 12 |
+
--private Create private repo
|
| 13 |
+
--org ORG Push to an organization (default: current user)
|
| 14 |
+
--message MSG Git commit message (default: "upload to huggingface")
|
| 15 |
+
--skip-create Do not create remote repo, only push
|
| 16 |
+
-h, --help Show this help
|
| 17 |
+
|
| 18 |
+
Examples:
|
| 19 |
+
bash scripts/upload_to_hf.sh --repo fic-agent --type dataset --private
|
| 20 |
+
bash scripts/upload_to_hf.sh --repo fic-agent-demo --type space --org my-org
|
| 21 |
+
EOF
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
REPO_NAME="fic-agent"
|
| 25 |
+
REPO_TYPE="dataset"
|
| 26 |
+
PRIVATE=0
|
| 27 |
+
ORG=""
|
| 28 |
+
COMMIT_MSG="upload to huggingface"
|
| 29 |
+
SKIP_CREATE=0
|
| 30 |
+
|
| 31 |
+
while [[ $# -gt 0 ]]; do
|
| 32 |
+
case "$1" in
|
| 33 |
+
--repo)
|
| 34 |
+
REPO_NAME="${2:?missing repo name}"
|
| 35 |
+
shift 2
|
| 36 |
+
;;
|
| 37 |
+
--type)
|
| 38 |
+
REPO_TYPE="${2:?missing repo type}"
|
| 39 |
+
shift 2
|
| 40 |
+
;;
|
| 41 |
+
--private)
|
| 42 |
+
PRIVATE=1
|
| 43 |
+
shift
|
| 44 |
+
;;
|
| 45 |
+
--org)
|
| 46 |
+
ORG="${2:?missing org name}"
|
| 47 |
+
shift 2
|
| 48 |
+
;;
|
| 49 |
+
--message)
|
| 50 |
+
COMMIT_MSG="${2:?missing commit message}"
|
| 51 |
+
shift 2
|
| 52 |
+
;;
|
| 53 |
+
--skip-create)
|
| 54 |
+
SKIP_CREATE=1
|
| 55 |
+
shift
|
| 56 |
+
;;
|
| 57 |
+
-h|--help)
|
| 58 |
+
usage
|
| 59 |
+
exit 0
|
| 60 |
+
;;
|
| 61 |
+
*)
|
| 62 |
+
echo "Unknown arg: $1"
|
| 63 |
+
usage
|
| 64 |
+
exit 1
|
| 65 |
+
;;
|
| 66 |
+
esac
|
| 67 |
+
done
|
| 68 |
+
|
| 69 |
+
if [[ "$REPO_TYPE" != "model" && "$REPO_TYPE" != "dataset" && "$REPO_TYPE" != "space" ]]; then
|
| 70 |
+
echo "Invalid --type: $REPO_TYPE (must be model|dataset|space)"
|
| 71 |
+
exit 1
|
| 72 |
+
fi
|
| 73 |
+
|
| 74 |
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
| 75 |
+
PROJECT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
| 76 |
+
cd "$PROJECT_DIR"
|
| 77 |
+
|
| 78 |
+
for cmd in git python; do
|
| 79 |
+
if ! command -v "$cmd" >/dev/null 2>&1; then
|
| 80 |
+
echo "Missing command: $cmd"
|
| 81 |
+
echo "Please install dependencies first, e.g.:"
|
| 82 |
+
echo " python -m pip install -U huggingface_hub git-lfs"
|
| 83 |
+
exit 1
|
| 84 |
+
fi
|
| 85 |
+
done
|
| 86 |
+
|
| 87 |
+
if ! python - <<'PY' >/dev/null 2>&1
|
| 88 |
+
import huggingface_hub # noqa: F401
|
| 89 |
+
PY
|
| 90 |
+
then
|
| 91 |
+
echo "Missing Python package: huggingface_hub"
|
| 92 |
+
echo "Please install dependencies first, e.g.:"
|
| 93 |
+
echo " python -m pip install -U huggingface_hub git-lfs"
|
| 94 |
+
exit 1
|
| 95 |
+
fi
|
| 96 |
+
|
| 97 |
+
if command -v git-lfs >/dev/null 2>&1; then
|
| 98 |
+
git lfs install >/dev/null
|
| 99 |
+
fi
|
| 100 |
+
|
| 101 |
+
if [[ -z "$ORG" ]]; then
|
| 102 |
+
if ! ORG="$(python - <<'PY'
|
| 103 |
+
import json
|
| 104 |
+
import sys
|
| 105 |
+
from huggingface_hub import HfApi
|
| 106 |
+
|
| 107 |
+
api = HfApi()
|
| 108 |
+
try:
|
| 109 |
+
who = api.whoami()
|
| 110 |
+
except Exception:
|
| 111 |
+
sys.exit(2)
|
| 112 |
+
name = who.get("name") or who.get("user")
|
| 113 |
+
if not name:
|
| 114 |
+
sys.exit(3)
|
| 115 |
+
print(name)
|
| 116 |
+
PY
|
| 117 |
+
)"; then
|
| 118 |
+
echo "Not logged in to Hugging Face."
|
| 119 |
+
echo "Please run one of:"
|
| 120 |
+
echo " hf auth login"
|
| 121 |
+
echo " huggingface-cli login"
|
| 122 |
+
exit 1
|
| 123 |
+
fi
|
| 124 |
+
else
|
| 125 |
+
# Validate auth even when org is provided.
|
| 126 |
+
if ! python - <<'PY' >/dev/null 2>&1
|
| 127 |
+
from huggingface_hub import HfApi
|
| 128 |
+
HfApi().whoami()
|
| 129 |
+
PY
|
| 130 |
+
then
|
| 131 |
+
echo "Not logged in to Hugging Face."
|
| 132 |
+
echo "Please run one of:"
|
| 133 |
+
echo " hf auth login"
|
| 134 |
+
echo " huggingface-cli login"
|
| 135 |
+
exit 1
|
| 136 |
+
fi
|
| 137 |
+
fi
|
| 138 |
+
|
| 139 |
+
if [[ -z "$ORG" ]]; then
|
| 140 |
+
echo "Could not detect username from Hugging Face auth."
|
| 141 |
+
echo "Please pass --org <username_or_org>."
|
| 142 |
+
exit 1
|
| 143 |
+
fi
|
| 144 |
+
|
| 145 |
+
if [[ -z "$ORG" ]]; then
|
| 146 |
+
echo "Could not detect username from 'huggingface-cli whoami'."
|
| 147 |
+
echo "Please pass --org <username_or_org>."
|
| 148 |
+
exit 1
|
| 149 |
+
fi
|
| 150 |
+
|
| 151 |
+
if [[ ! -d .git ]]; then
|
| 152 |
+
git init
|
| 153 |
+
fi
|
| 154 |
+
|
| 155 |
+
git branch -M main
|
| 156 |
+
|
| 157 |
+
if [[ ! -f .gitignore ]]; then
|
| 158 |
+
cat > .gitignore <<'EOF'
|
| 159 |
+
__pycache__/
|
| 160 |
+
*.pyc
|
| 161 |
+
.env
|
| 162 |
+
outputs/
|
| 163 |
+
EOF
|
| 164 |
+
fi
|
| 165 |
+
|
| 166 |
+
if [[ "$SKIP_CREATE" -eq 0 ]]; then
|
| 167 |
+
if [[ "$PRIVATE" -eq 1 ]]; then
|
| 168 |
+
PRIVATE_PY="True"
|
| 169 |
+
else
|
| 170 |
+
PRIVATE_PY="False"
|
| 171 |
+
fi
|
| 172 |
+
if ! python - <<PY
|
| 173 |
+
from huggingface_hub import HfApi
|
| 174 |
+
|
| 175 |
+
api = HfApi()
|
| 176 |
+
api.create_repo(
|
| 177 |
+
repo_id="${ORG}/${REPO_NAME}",
|
| 178 |
+
repo_type="${REPO_TYPE}",
|
| 179 |
+
private=${PRIVATE_PY},
|
| 180 |
+
exist_ok=True,
|
| 181 |
+
)
|
| 182 |
+
print("Remote repo ready: ${ORG}/${REPO_NAME} (${REPO_TYPE})")
|
| 183 |
+
PY
|
| 184 |
+
then
|
| 185 |
+
echo "Repo creation failed. You can rerun with --skip-create if it already exists."
|
| 186 |
+
exit 1
|
| 187 |
+
fi
|
| 188 |
+
fi
|
| 189 |
+
|
| 190 |
+
case "$REPO_TYPE" in
|
| 191 |
+
model)
|
| 192 |
+
REMOTE_URL="https://huggingface.co/${ORG}/${REPO_NAME}"
|
| 193 |
+
;;
|
| 194 |
+
dataset)
|
| 195 |
+
REMOTE_URL="https://huggingface.co/datasets/${ORG}/${REPO_NAME}"
|
| 196 |
+
;;
|
| 197 |
+
space)
|
| 198 |
+
REMOTE_URL="https://huggingface.co/spaces/${ORG}/${REPO_NAME}"
|
| 199 |
+
;;
|
| 200 |
+
esac
|
| 201 |
+
|
| 202 |
+
if git remote get-url origin >/dev/null 2>&1; then
|
| 203 |
+
git remote set-url origin "$REMOTE_URL"
|
| 204 |
+
else
|
| 205 |
+
git remote add origin "$REMOTE_URL"
|
| 206 |
+
fi
|
| 207 |
+
|
| 208 |
+
git add -A
|
| 209 |
+
if ! git diff --cached --quiet; then
|
| 210 |
+
git commit -m "$COMMIT_MSG"
|
| 211 |
+
else
|
| 212 |
+
echo "No staged changes to commit."
|
| 213 |
+
fi
|
| 214 |
+
|
| 215 |
+
git push -u origin main
|
| 216 |
+
echo "Done. Pushed to: $REMOTE_URL"
|
src/fic_agent.egg-info/PKG-INFO
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.4
|
| 2 |
+
Name: fic-agent
|
| 3 |
+
Version: 0.0.1
|
| 4 |
+
Summary: No-finetune fiction character agent
|
| 5 |
+
Requires-Python: >=3.9
|
| 6 |
+
Description-Content-Type: text/markdown
|
| 7 |
+
Requires-Dist: openai>=1.0.0
|
| 8 |
+
Requires-Dist: pydantic>=2.0.0
|
| 9 |
+
Requires-Dist: numpy>=1.24.0
|
| 10 |
+
Requires-Dist: tiktoken>=0.5.0
|
| 11 |
+
Requires-Dist: pandas>=2.0.0
|
| 12 |
+
Requires-Dist: faiss-cpu>=1.7.4
|
| 13 |
+
|
| 14 |
+
# fic-agent
|
| 15 |
+
|
| 16 |
+
A no-finetune, retrieval-augmented character chatbot for fiction.
|
| 17 |
+
|
| 18 |
+
## Goals
|
| 19 |
+
- Factual consistency with the source text
|
| 20 |
+
- Character-true language style and emotional profile
|
| 21 |
+
- Worldview consistency (settings, rules, relationships)
|
| 22 |
+
|
| 23 |
+
## Repository layout
|
| 24 |
+
- `configs/` Runtime configs (API keys, model names, flags)
|
| 25 |
+
- `data/raw/` Raw novels and metadata
|
| 26 |
+
- `data/processed/` Chunked text, extracted dialogues, persona notes
|
| 27 |
+
- `data/indexes/` Vector indexes and graph artifacts
|
| 28 |
+
- `data/eval/` Evaluation inputs and references
|
| 29 |
+
- `outputs/` Run outputs and logs
|
| 30 |
+
- `scripts/` CLI helpers and pipelines
|
| 31 |
+
- `src/fic_agent/` Core library
|
| 32 |
+
|
| 33 |
+
## Core pipeline (high level)
|
| 34 |
+
1. Ingest raw text
|
| 35 |
+
2. Extract character dialogue + context
|
| 36 |
+
3. Build persona profile (style, affect, worldview)
|
| 37 |
+
4. Build fact and worldview indexes
|
| 38 |
+
5. Retrieve relevant evidence + persona
|
| 39 |
+
6. Generate response with persona-conditioned prompt
|
| 40 |
+
7. Evaluate (facts, style, worldview)
|
| 41 |
+
|
| 42 |
+
## Next steps
|
| 43 |
+
- Implement ingestion and dialogue extraction
|
| 44 |
+
- Define persona schema and prompt templates
|
| 45 |
+
- Add evaluation scripts and judges
|
src/fic_agent.egg-info/SOURCES.txt
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
README.md
|
| 2 |
+
pyproject.toml
|
| 3 |
+
src/fic_agent/__init__.py
|
| 4 |
+
src/fic_agent/config.py
|
| 5 |
+
src/fic_agent.egg-info/PKG-INFO
|
| 6 |
+
src/fic_agent.egg-info/SOURCES.txt
|
| 7 |
+
src/fic_agent.egg-info/dependency_links.txt
|
| 8 |
+
src/fic_agent.egg-info/requires.txt
|
| 9 |
+
src/fic_agent.egg-info/top_level.txt
|
| 10 |
+
src/fic_agent/eval/__init__.py
|
| 11 |
+
src/fic_agent/eval/judge.py
|
| 12 |
+
src/fic_agent/generation/__init__.py
|
| 13 |
+
src/fic_agent/generation/compose.py
|
| 14 |
+
src/fic_agent/ingest/__init__.py
|
| 15 |
+
src/fic_agent/ingest/pipeline.py
|
| 16 |
+
src/fic_agent/persona/__init__.py
|
| 17 |
+
src/fic_agent/persona/profile.py
|
| 18 |
+
src/fic_agent/retrieval/__init__.py
|
| 19 |
+
src/fic_agent/retrieval/embeddings.py
|
| 20 |
+
src/fic_agent/retrieval/retriever.py
|
| 21 |
+
src/fic_agent/retrieval/vector_store.py
|
| 22 |
+
src/fic_agent/utils/__init__.py
|
| 23 |
+
src/fic_agent/utils/io.py
|
| 24 |
+
src/fic_agent/worldview/__init__.py
|
| 25 |
+
src/fic_agent/worldview/worldview.py
|
src/fic_agent.egg-info/dependency_links.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
|
src/fic_agent.egg-info/requires.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
openai>=1.0.0
|
| 2 |
+
pydantic>=2.0.0
|
| 3 |
+
numpy>=1.24.0
|
| 4 |
+
tiktoken>=0.5.0
|
| 5 |
+
pandas>=2.0.0
|
| 6 |
+
faiss-cpu>=1.7.4
|
src/fic_agent.egg-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
fic_agent
|
src/fic_agent/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
"""fic-agent package."""
|
src/fic_agent/config.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from dataclasses import dataclass
|
| 2 |
+
import os
|
| 3 |
+
from typing import Optional
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
@dataclass
|
| 7 |
+
class RuntimeConfig:
|
| 8 |
+
"""Runtime configuration for fic-agent."""
|
| 9 |
+
|
| 10 |
+
llm_base_url: str = "https://openrouter.ai/api/v1"
|
| 11 |
+
llm_api_key: Optional[str] = (
|
| 12 |
+
os.getenv("LLM_API_KEY")
|
| 13 |
+
or os.getenv("OPENAI_API_KEY")
|
| 14 |
+
or os.getenv("OPENROUTER_API_KEY")
|
| 15 |
+
)
|
| 16 |
+
llm_model: str = "openai/gpt-4o-mini"
|
| 17 |
+
|
| 18 |
+
embedding_base_url: str = "https://openrouter.ai/api/v1"
|
| 19 |
+
embedding_api_key: Optional[str] = (
|
| 20 |
+
os.getenv("EMBEDDING_API_KEY")
|
| 21 |
+
or os.getenv("OPENAI_API_KEY")
|
| 22 |
+
or os.getenv("OPENROUTER_API_KEY")
|
| 23 |
+
)
|
| 24 |
+
embedding_model: str = "openai/text-embedding-3-small"
|
| 25 |
+
embedding_batch_size: int = 64
|
| 26 |
+
|
| 27 |
+
api_progress: bool = True
|
| 28 |
+
api_progress_every: int = 10
|
| 29 |
+
speaker_llm_enabled: bool = True
|
| 30 |
+
speaker_llm_model: Optional[str] = None
|
| 31 |
+
speaker_llm_temperature: float = 0.0
|
| 32 |
+
speaker_llm_max_tokens: int = 256
|
| 33 |
+
speaker_strict_candidates: bool = True
|
| 34 |
+
worldview_entity_llm_refine: bool = True
|
| 35 |
+
|
| 36 |
+
project_root: str = "."
|
| 37 |
+
data_raw_dir: str = "data/raw"
|
| 38 |
+
data_processed_dir: str = "data/processed"
|
| 39 |
+
data_index_dir: str = "data/indexes"
|
| 40 |
+
output_dir: str = "outputs"
|
| 41 |
+
|
| 42 |
+
max_context_tokens: int = 3000
|
| 43 |
+
top_k_facts: int = 8
|
| 44 |
+
top_k_persona: int = 5
|
| 45 |
+
top_k_worldview: int = 5
|
| 46 |
+
|
| 47 |
+
# Tri-retrieve knobs
|
| 48 |
+
tri_k_min: int = 3
|
| 49 |
+
tri_k_max: int = 20
|
| 50 |
+
tri_score_delta: float = 0.08
|
| 51 |
+
tri_score_tau: float = 0.6
|
| 52 |
+
tri_tau_low: float = 0.35
|
| 53 |
+
tri_mmr_lambda: float = 0.7
|
| 54 |
+
tri_candidate_pool: int = 60
|
| 55 |
+
|
| 56 |
+
tri_budget_fact: int = 1200
|
| 57 |
+
tri_budget_persona: int = 700
|
| 58 |
+
tri_budget_worldview: int = 700
|
| 59 |
+
tri_budget_shift: int = 300
|
| 60 |
+
|
| 61 |
+
# Weighted scoring terms for each lane.
|
| 62 |
+
fact_w_cos: float = 1.0
|
| 63 |
+
fact_w_entity: float = 0.2
|
| 64 |
+
fact_w_recency: float = 0.1
|
| 65 |
+
fact_w_graph: float = 0.0
|
| 66 |
+
|
| 67 |
+
persona_w_cos: float = 1.0
|
| 68 |
+
persona_w_speaker: float = 0.35
|
| 69 |
+
persona_w_style: float = 0.3
|
| 70 |
+
|
| 71 |
+
worldview_w_cos: float = 1.0
|
| 72 |
+
worldview_w_rule: float = 0.25
|
| 73 |
+
worldview_w_locorg: float = 0.2
|
| 74 |
+
|
| 75 |
+
# Meta-cognitive QA loop
|
| 76 |
+
meta_max_iterations: int = 3
|
| 77 |
+
meta_trace_top_n: int = 6
|
| 78 |
+
meta_new_probe_max_tokens: int = 220
|
| 79 |
+
meta_judge_model: Optional[str] = None
|
| 80 |
+
meta_judge_temperature: float = 0.0
|
src/fic_agent/eval/__init__.py
ADDED
|
File without changes
|
src/fic_agent/eval/judge.py
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Evaluation utilities for factuality/style/worldview consistency."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import json
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
import re
|
| 8 |
+
from typing import Dict, Iterable, List, Optional, Sequence
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
WORD_RE = re.compile(r"[A-Za-z']+")
|
| 12 |
+
ENTITY_RE = re.compile(r"\b([A-Z][a-z]+(?:\s+[A-Z][a-z]+){0,2})\b")
|
| 13 |
+
STOPWORDS = {
|
| 14 |
+
"a",
|
| 15 |
+
"an",
|
| 16 |
+
"and",
|
| 17 |
+
"are",
|
| 18 |
+
"as",
|
| 19 |
+
"at",
|
| 20 |
+
"be",
|
| 21 |
+
"by",
|
| 22 |
+
"for",
|
| 23 |
+
"from",
|
| 24 |
+
"in",
|
| 25 |
+
"is",
|
| 26 |
+
"it",
|
| 27 |
+
"of",
|
| 28 |
+
"on",
|
| 29 |
+
"or",
|
| 30 |
+
"that",
|
| 31 |
+
"the",
|
| 32 |
+
"to",
|
| 33 |
+
"was",
|
| 34 |
+
"were",
|
| 35 |
+
"with",
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def _tokenize(text: str) -> List[str]:
|
| 40 |
+
return [w.lower().strip("'") for w in WORD_RE.findall(text or "") if w.strip("'")]
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
def _keyword_set(text: str) -> set[str]:
|
| 44 |
+
return {t for t in _tokenize(text) if len(t) >= 3 and t not in STOPWORDS}
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def _entities(text: str) -> set[str]:
|
| 48 |
+
ents = {m.group(1).strip().lower() for m in ENTITY_RE.finditer(text or "")}
|
| 49 |
+
if ents:
|
| 50 |
+
return ents
|
| 51 |
+
return {t for t in _keyword_set(text) if len(t) >= 5}
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def _overlap_ratio(a: set[str], b: set[str]) -> float:
|
| 55 |
+
if not a:
|
| 56 |
+
return 0.0
|
| 57 |
+
return len(a & b) / max(1, len(a))
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def _load_persona_markers(processed_dir: str, character: Optional[str]) -> List[str]:
|
| 61 |
+
if not character:
|
| 62 |
+
return []
|
| 63 |
+
safe = character.replace("/", "_")
|
| 64 |
+
path = Path(processed_dir) / f"persona_{safe}.json"
|
| 65 |
+
if not path.exists():
|
| 66 |
+
return []
|
| 67 |
+
try:
|
| 68 |
+
obj = json.loads(path.read_text(encoding="utf-8"))
|
| 69 |
+
except Exception:
|
| 70 |
+
return []
|
| 71 |
+
markers = obj.get("style_markers")
|
| 72 |
+
if not isinstance(markers, list):
|
| 73 |
+
return []
|
| 74 |
+
return [str(x).strip().lower() for x in markers if str(x).strip()]
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
def _style_marker_recall(response: str, markers: Sequence[str]) -> float:
|
| 78 |
+
if not markers:
|
| 79 |
+
return 0.0
|
| 80 |
+
text_l = (response or "").lower()
|
| 81 |
+
token_set = set(_tokenize(text_l))
|
| 82 |
+
hits = 0
|
| 83 |
+
for m in markers:
|
| 84 |
+
if " " in m:
|
| 85 |
+
if m in text_l:
|
| 86 |
+
hits += 1
|
| 87 |
+
elif m in token_set:
|
| 88 |
+
hits += 1
|
| 89 |
+
return hits / max(1, len(markers))
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
def _facts_consistency(response: str, fact_evidence: Iterable[Dict]) -> float:
|
| 93 |
+
e_text = " ".join(str(r.get("text", "")) for r in fact_evidence)
|
| 94 |
+
return _overlap_ratio(_entities(response), _entities(e_text))
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
def _worldview_consistency(response: str, worldview_evidence: Iterable[Dict]) -> float:
|
| 98 |
+
e_text = " ".join(str(r.get("text", "")) for r in worldview_evidence)
|
| 99 |
+
return _overlap_ratio(_keyword_set(response), _keyword_set(e_text))
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
def score_response(
|
| 103 |
+
response: str,
|
| 104 |
+
evidence: Dict[str, List[Dict]],
|
| 105 |
+
character: Optional[str] = None,
|
| 106 |
+
processed_dir: str = "data/processed",
|
| 107 |
+
) -> Dict[str, float]:
|
| 108 |
+
"""Return quantifiable proxy metrics in [0,1].
|
| 109 |
+
|
| 110 |
+
- facts: entity overlap between response and fact evidence
|
| 111 |
+
- style: marker recall from character persona profile
|
| 112 |
+
- worldview: keyword overlap between response and worldview evidence
|
| 113 |
+
"""
|
| 114 |
+
facts = list(evidence.get("facts", []))
|
| 115 |
+
worldview = list(evidence.get("worldview", []))
|
| 116 |
+
markers = _load_persona_markers(processed_dir=processed_dir, character=character)
|
| 117 |
+
return {
|
| 118 |
+
"facts": float(_facts_consistency(response, facts)),
|
| 119 |
+
"style": float(_style_marker_recall(response, markers)),
|
| 120 |
+
"worldview": float(_worldview_consistency(response, worldview)),
|
| 121 |
+
}
|
src/fic_agent/generation/__init__.py
ADDED
|
File without changes
|
src/fic_agent/generation/compose.py
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Response composition with fact-first persona-biased fusion."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from dataclasses import dataclass
|
| 6 |
+
import json
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
from typing import Dict, List, Optional
|
| 9 |
+
|
| 10 |
+
from ..config import RuntimeConfig
|
| 11 |
+
from ..retrieval.retriever import tri_retrieve
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
@dataclass
|
| 15 |
+
class FusionResult:
|
| 16 |
+
answer: str
|
| 17 |
+
draft: str
|
| 18 |
+
evidence: Dict[str, object]
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def _load_persona_profile(cfg: RuntimeConfig, character: Optional[str]) -> Dict:
|
| 22 |
+
if not character:
|
| 23 |
+
return {}
|
| 24 |
+
safe = character.replace("/", "_")
|
| 25 |
+
profile_path = Path(cfg.data_processed_dir) / f"persona_{safe}.json"
|
| 26 |
+
if not profile_path.exists():
|
| 27 |
+
return {}
|
| 28 |
+
try:
|
| 29 |
+
with open(profile_path, "r", encoding="utf-8") as f:
|
| 30 |
+
return json.load(f)
|
| 31 |
+
except Exception:
|
| 32 |
+
return {}
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def _format_lane_rows(rows: List[Dict], lane_tag: str, max_rows: int = 6) -> str:
|
| 36 |
+
if not rows:
|
| 37 |
+
return "(none)"
|
| 38 |
+
lines: List[str] = []
|
| 39 |
+
for i, row in enumerate(rows[:max_rows], start=1):
|
| 40 |
+
text = str(row.get("text", "")).strip().replace("\n", " ")
|
| 41 |
+
score = float(row.get("score", 0.0))
|
| 42 |
+
extra = ""
|
| 43 |
+
if lane_tag == "P":
|
| 44 |
+
speaker = row.get("speaker")
|
| 45 |
+
extra = f" speaker={speaker}" if speaker else ""
|
| 46 |
+
if lane_tag == "W":
|
| 47 |
+
t = row.get("type")
|
| 48 |
+
ent = row.get("entity")
|
| 49 |
+
parts = []
|
| 50 |
+
if t:
|
| 51 |
+
parts.append(f"type={t}")
|
| 52 |
+
if ent:
|
| 53 |
+
parts.append(f"entity={ent}")
|
| 54 |
+
extra = (" " + " ".join(parts)) if parts else ""
|
| 55 |
+
lines.append(f"[{lane_tag}{i}] score={score:.3f}{extra} text={text}")
|
| 56 |
+
return "\n".join(lines)
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
def _build_fusion_prompts(
|
| 60 |
+
query: str,
|
| 61 |
+
evidence: Dict[str, object],
|
| 62 |
+
character: Optional[str],
|
| 63 |
+
persona_profile: Dict,
|
| 64 |
+
) -> tuple[str, str]:
|
| 65 |
+
facts = evidence.get("facts", [])
|
| 66 |
+
persona = evidence.get("persona", [])
|
| 67 |
+
worldview = evidence.get("worldview", [])
|
| 68 |
+
query_plan = evidence.get("query_plan", {})
|
| 69 |
+
|
| 70 |
+
style_markers = persona_profile.get("style_markers", [])
|
| 71 |
+
speaking_rules = persona_profile.get("speaking_rules", [])
|
| 72 |
+
values = persona_profile.get("values", [])
|
| 73 |
+
|
| 74 |
+
system_prompt = (
|
| 75 |
+
"You are a retrieval-grounded fiction dialogue assistant.\n"
|
| 76 |
+
"Priority policy:\n"
|
| 77 |
+
"1) Facts evidence is highest priority.\n"
|
| 78 |
+
"2) Worldview evidence is second priority.\n"
|
| 79 |
+
"3) Persona style is third priority.\n"
|
| 80 |
+
"If style conflicts with facts/worldview, keep facts/worldview.\n"
|
| 81 |
+
"Do not invent unsupported facts.\n"
|
| 82 |
+
"When possible, cite evidence IDs like [F1], [W2], [P1]."
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
user_prompt = (
|
| 86 |
+
f"User query:\n{query}\n\n"
|
| 87 |
+
f"Character:\n{character or 'Unknown'}\n\n"
|
| 88 |
+
f"Query decomposition:\n{json.dumps(query_plan, ensure_ascii=False)}\n\n"
|
| 89 |
+
f"Character style markers:\n{', '.join(style_markers) if style_markers else '(none)'}\n"
|
| 90 |
+
f"Character speaking rules:\n{'; '.join(speaking_rules) if speaking_rules else '(none)'}\n"
|
| 91 |
+
f"Character values:\n{', '.join(values) if values else '(none)'}\n\n"
|
| 92 |
+
f"Facts evidence:\n{_format_lane_rows(facts, 'F')}\n\n"
|
| 93 |
+
f"Worldview evidence:\n{_format_lane_rows(worldview, 'W')}\n\n"
|
| 94 |
+
f"Persona evidence:\n{_format_lane_rows(persona, 'P')}\n\n"
|
| 95 |
+
"Generate a concise in-character answer with factual consistency."
|
| 96 |
+
)
|
| 97 |
+
return system_prompt, user_prompt
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
def _build_style_correction_prompts(
|
| 101 |
+
draft: str,
|
| 102 |
+
character: Optional[str],
|
| 103 |
+
persona_profile: Dict,
|
| 104 |
+
) -> tuple[str, str]:
|
| 105 |
+
style_markers = persona_profile.get("style_markers", [])
|
| 106 |
+
speaking_rules = persona_profile.get("speaking_rules", [])
|
| 107 |
+
examples = persona_profile.get("examples", [])
|
| 108 |
+
|
| 109 |
+
system_prompt = (
|
| 110 |
+
"You are a style editor for fictional roleplay.\n"
|
| 111 |
+
"Rewrite only style/tone/wording to match the target character.\n"
|
| 112 |
+
"Do NOT change factual content or claims.\n"
|
| 113 |
+
"Do NOT add new facts."
|
| 114 |
+
)
|
| 115 |
+
user_prompt = (
|
| 116 |
+
f"Character: {character or 'Unknown'}\n"
|
| 117 |
+
f"Style markers: {', '.join(style_markers) if style_markers else '(none)'}\n"
|
| 118 |
+
f"Speaking rules: {'; '.join(speaking_rules) if speaking_rules else '(none)'}\n"
|
| 119 |
+
f"Example lines: {' | '.join(examples[:3]) if examples else '(none)'}\n\n"
|
| 120 |
+
f"Draft answer:\n{draft}\n\n"
|
| 121 |
+
"Return revised answer only."
|
| 122 |
+
)
|
| 123 |
+
return system_prompt, user_prompt
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
def _heuristic_fallback_answer(query: str, evidence: Dict[str, object], character: Optional[str]) -> str:
|
| 127 |
+
facts = evidence.get("facts", [])[:3]
|
| 128 |
+
worldview = evidence.get("worldview", [])[:2]
|
| 129 |
+
persona = evidence.get("persona", [])[:2]
|
| 130 |
+
|
| 131 |
+
lines = [f"Q: {query}", ""]
|
| 132 |
+
if character:
|
| 133 |
+
lines.append(f"Character: {character}")
|
| 134 |
+
lines.append("Fact-grounded points:")
|
| 135 |
+
if facts:
|
| 136 |
+
for row in facts:
|
| 137 |
+
lines.append(f"- {row.get('text', '')}")
|
| 138 |
+
else:
|
| 139 |
+
lines.append("- (no strong fact evidence found)")
|
| 140 |
+
lines.append("World consistency notes:")
|
| 141 |
+
if worldview:
|
| 142 |
+
for row in worldview:
|
| 143 |
+
lines.append(f"- {row.get('text', '')}")
|
| 144 |
+
else:
|
| 145 |
+
lines.append("- (no worldview constraints retrieved)")
|
| 146 |
+
lines.append("Persona cues:")
|
| 147 |
+
if persona:
|
| 148 |
+
for row in persona:
|
| 149 |
+
lines.append(f"- {row.get('text', '')}")
|
| 150 |
+
else:
|
| 151 |
+
lines.append("- (no persona cue retrieved)")
|
| 152 |
+
return "\n".join(lines)
|
| 153 |
+
|
| 154 |
+
|
| 155 |
+
def compose_response(
|
| 156 |
+
query: str,
|
| 157 |
+
evidence: Dict[str, object],
|
| 158 |
+
cfg: RuntimeConfig,
|
| 159 |
+
character: Optional[str] = None,
|
| 160 |
+
style_correct: bool = False,
|
| 161 |
+
) -> str:
|
| 162 |
+
profile = _load_persona_profile(cfg, character)
|
| 163 |
+
if not cfg.llm_api_key:
|
| 164 |
+
return _heuristic_fallback_answer(query=query, evidence=evidence, character=character)
|
| 165 |
+
|
| 166 |
+
try:
|
| 167 |
+
from openai import OpenAI # type: ignore
|
| 168 |
+
except Exception as e:
|
| 169 |
+
raise ImportError(
|
| 170 |
+
"openai package is required for LLM composition. Install dependencies first."
|
| 171 |
+
) from e
|
| 172 |
+
|
| 173 |
+
client = OpenAI(base_url=cfg.llm_base_url, api_key=cfg.llm_api_key)
|
| 174 |
+
sys_prompt, user_prompt = _build_fusion_prompts(
|
| 175 |
+
query=query,
|
| 176 |
+
evidence=evidence,
|
| 177 |
+
character=character,
|
| 178 |
+
persona_profile=profile,
|
| 179 |
+
)
|
| 180 |
+
draft_resp = client.chat.completions.create(
|
| 181 |
+
model=cfg.llm_model,
|
| 182 |
+
messages=[
|
| 183 |
+
{"role": "system", "content": sys_prompt},
|
| 184 |
+
{"role": "user", "content": user_prompt},
|
| 185 |
+
],
|
| 186 |
+
temperature=0.2,
|
| 187 |
+
max_tokens=700,
|
| 188 |
+
)
|
| 189 |
+
draft = (draft_resp.choices[0].message.content or "").strip()
|
| 190 |
+
if not draft:
|
| 191 |
+
return _heuristic_fallback_answer(query=query, evidence=evidence, character=character)
|
| 192 |
+
if not style_correct:
|
| 193 |
+
return draft
|
| 194 |
+
|
| 195 |
+
style_sys, style_user = _build_style_correction_prompts(
|
| 196 |
+
draft=draft,
|
| 197 |
+
character=character,
|
| 198 |
+
persona_profile=profile,
|
| 199 |
+
)
|
| 200 |
+
style_resp = client.chat.completions.create(
|
| 201 |
+
model=cfg.llm_model,
|
| 202 |
+
messages=[
|
| 203 |
+
{"role": "system", "content": style_sys},
|
| 204 |
+
{"role": "user", "content": style_user},
|
| 205 |
+
],
|
| 206 |
+
temperature=0.1,
|
| 207 |
+
max_tokens=700,
|
| 208 |
+
)
|
| 209 |
+
revised = (style_resp.choices[0].message.content or "").strip()
|
| 210 |
+
return revised or draft
|
| 211 |
+
|
| 212 |
+
|
| 213 |
+
def run_tri_retrieve_and_compose(
|
| 214 |
+
query: str,
|
| 215 |
+
cfg: RuntimeConfig,
|
| 216 |
+
character: Optional[str] = None,
|
| 217 |
+
style_correct: bool = False,
|
| 218 |
+
) -> FusionResult:
|
| 219 |
+
evidence = tri_retrieve(query=query, cfg=cfg, character=character)
|
| 220 |
+
draft = compose_response(
|
| 221 |
+
query=query,
|
| 222 |
+
evidence=evidence,
|
| 223 |
+
cfg=cfg,
|
| 224 |
+
character=character,
|
| 225 |
+
style_correct=False,
|
| 226 |
+
)
|
| 227 |
+
final_answer = draft
|
| 228 |
+
if style_correct:
|
| 229 |
+
final_answer = compose_response(
|
| 230 |
+
query=query,
|
| 231 |
+
evidence=evidence,
|
| 232 |
+
cfg=cfg,
|
| 233 |
+
character=character,
|
| 234 |
+
style_correct=True,
|
| 235 |
+
)
|
| 236 |
+
return FusionResult(answer=final_answer, draft=draft, evidence=evidence)
|
src/fic_agent/generation/meta_loop.py
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Meta-cognitive QA loop: retrieve -> assess -> probe -> retrieve -> compose."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from dataclasses import dataclass, field
|
| 6 |
+
import json
|
| 7 |
+
from typing import Dict, List, Optional
|
| 8 |
+
|
| 9 |
+
from ..config import RuntimeConfig
|
| 10 |
+
from ..retrieval.retriever import decompose_query, tri_retrieve
|
| 11 |
+
from .compose import compose_response
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
@dataclass
|
| 15 |
+
class LoopStep:
|
| 16 |
+
iteration: int
|
| 17 |
+
probe: str
|
| 18 |
+
sufficient: bool
|
| 19 |
+
confidence: float
|
| 20 |
+
missing: List[str] = field(default_factory=list)
|
| 21 |
+
next_probe: Optional[str] = None
|
| 22 |
+
evidence_counts: Dict[str, int] = field(default_factory=dict)
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
@dataclass
|
| 26 |
+
class MetaLoopResult:
|
| 27 |
+
answer: str
|
| 28 |
+
evidence: Dict[str, object]
|
| 29 |
+
trace: List[LoopStep]
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def _safe_text(v: object) -> str:
|
| 33 |
+
return str(v or "").strip()
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def _dedup_merge_rows(existing: List[Dict], new_rows: List[Dict], lane: str) -> List[Dict]:
|
| 37 |
+
merged = list(existing)
|
| 38 |
+
seen = {
|
| 39 |
+
(
|
| 40 |
+
lane,
|
| 41 |
+
_safe_text(r.get("id")),
|
| 42 |
+
_safe_text(r.get("text")),
|
| 43 |
+
_safe_text(r.get("speaker")),
|
| 44 |
+
_safe_text(r.get("entity")),
|
| 45 |
+
)
|
| 46 |
+
for r in existing
|
| 47 |
+
}
|
| 48 |
+
for r in new_rows:
|
| 49 |
+
key = (
|
| 50 |
+
lane,
|
| 51 |
+
_safe_text(r.get("id")),
|
| 52 |
+
_safe_text(r.get("text")),
|
| 53 |
+
_safe_text(r.get("speaker")),
|
| 54 |
+
_safe_text(r.get("entity")),
|
| 55 |
+
)
|
| 56 |
+
if key in seen:
|
| 57 |
+
continue
|
| 58 |
+
seen.add(key)
|
| 59 |
+
merged.append(r)
|
| 60 |
+
merged.sort(key=lambda x: float(x.get("score", 0.0)), reverse=True)
|
| 61 |
+
return merged
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def _merge_evidence_pool(pool: Dict[str, object], delta: Dict[str, object]) -> Dict[str, object]:
|
| 65 |
+
out = dict(pool)
|
| 66 |
+
for lane in ("facts", "persona", "worldview"):
|
| 67 |
+
out[lane] = _dedup_merge_rows(
|
| 68 |
+
existing=list(out.get(lane, [])),
|
| 69 |
+
new_rows=list(delta.get(lane, [])),
|
| 70 |
+
lane=lane,
|
| 71 |
+
)
|
| 72 |
+
out["query_plan"] = delta.get("query_plan") or out.get("query_plan") or {}
|
| 73 |
+
out["budgets"] = delta.get("budgets") or out.get("budgets") or {}
|
| 74 |
+
return out
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
def _sample_rows(rows: List[Dict], top_n: int) -> List[Dict]:
|
| 78 |
+
sampled = []
|
| 79 |
+
for r in rows[:top_n]:
|
| 80 |
+
sampled.append(
|
| 81 |
+
{
|
| 82 |
+
"rank": r.get("rank"),
|
| 83 |
+
"score": r.get("score"),
|
| 84 |
+
"text": _safe_text(r.get("text"))[:260],
|
| 85 |
+
"speaker": r.get("speaker"),
|
| 86 |
+
"type": r.get("type"),
|
| 87 |
+
"entity": r.get("entity"),
|
| 88 |
+
}
|
| 89 |
+
)
|
| 90 |
+
return sampled
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
def _parse_json_object(text: str) -> Optional[Dict]:
|
| 94 |
+
if not text:
|
| 95 |
+
return None
|
| 96 |
+
try:
|
| 97 |
+
obj = json.loads(text)
|
| 98 |
+
if isinstance(obj, dict):
|
| 99 |
+
return obj
|
| 100 |
+
except json.JSONDecodeError:
|
| 101 |
+
pass
|
| 102 |
+
s = text.find("{")
|
| 103 |
+
e = text.rfind("}")
|
| 104 |
+
if s != -1 and e != -1 and e > s:
|
| 105 |
+
try:
|
| 106 |
+
obj = json.loads(text[s : e + 1])
|
| 107 |
+
if isinstance(obj, dict):
|
| 108 |
+
return obj
|
| 109 |
+
except json.JSONDecodeError:
|
| 110 |
+
return None
|
| 111 |
+
return None
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
def _heuristic_assess(pool: Dict[str, object], cfg: RuntimeConfig) -> Dict:
|
| 115 |
+
facts = list(pool.get("facts", []))
|
| 116 |
+
persona = list(pool.get("persona", []))
|
| 117 |
+
worldview = list(pool.get("worldview", []))
|
| 118 |
+
fact_max = max((float(r.get("score", 0.0)) for r in facts), default=0.0)
|
| 119 |
+
sufficient = (
|
| 120 |
+
len(facts) >= cfg.tri_k_min
|
| 121 |
+
and len(worldview) >= 1
|
| 122 |
+
and fact_max >= cfg.tri_tau_low
|
| 123 |
+
)
|
| 124 |
+
missing: List[str] = []
|
| 125 |
+
if len(facts) < cfg.tri_k_min:
|
| 126 |
+
missing.append("more veridical facts")
|
| 127 |
+
if len(worldview) < 1:
|
| 128 |
+
missing.append("world rules/setting evidence")
|
| 129 |
+
if len(persona) < 1:
|
| 130 |
+
missing.append("character speaking evidence")
|
| 131 |
+
next_probe = None
|
| 132 |
+
if missing:
|
| 133 |
+
next_probe = "Focus on: " + "; ".join(missing)
|
| 134 |
+
return {
|
| 135 |
+
"sufficient": sufficient,
|
| 136 |
+
"confidence": 0.75 if sufficient else 0.35,
|
| 137 |
+
"missing": missing,
|
| 138 |
+
"next_probe": next_probe,
|
| 139 |
+
"need_narrative": False,
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
def _llm_assess(
|
| 144 |
+
query: str,
|
| 145 |
+
character: Optional[str],
|
| 146 |
+
pool: Dict[str, object],
|
| 147 |
+
cfg: RuntimeConfig,
|
| 148 |
+
) -> Optional[Dict]:
|
| 149 |
+
if not cfg.llm_api_key:
|
| 150 |
+
return None
|
| 151 |
+
try:
|
| 152 |
+
from openai import OpenAI # type: ignore
|
| 153 |
+
except Exception:
|
| 154 |
+
return None
|
| 155 |
+
|
| 156 |
+
client = OpenAI(base_url=cfg.llm_base_url, api_key=cfg.llm_api_key)
|
| 157 |
+
model = cfg.meta_judge_model or cfg.llm_model
|
| 158 |
+
|
| 159 |
+
payload = {
|
| 160 |
+
"query": query,
|
| 161 |
+
"character": character,
|
| 162 |
+
"facts": _sample_rows(list(pool.get("facts", [])), cfg.meta_trace_top_n),
|
| 163 |
+
"persona": _sample_rows(list(pool.get("persona", [])), cfg.meta_trace_top_n),
|
| 164 |
+
"worldview": _sample_rows(list(pool.get("worldview", [])), cfg.meta_trace_top_n),
|
| 165 |
+
}
|
| 166 |
+
system_prompt = (
|
| 167 |
+
"You are an evidence sufficiency judge for a fiction QA agent.\n"
|
| 168 |
+
"Return JSON only with fields:\n"
|
| 169 |
+
"sufficient (bool), confidence (0-1), need_narrative (bool),\n"
|
| 170 |
+
"missing (array of short strings), next_probe (string).\n"
|
| 171 |
+
"If evidence is weak, provide a concrete next_probe query for retrieval.\n"
|
| 172 |
+
"Keep next_probe under 20 words."
|
| 173 |
+
)
|
| 174 |
+
user_prompt = "Assess if evidence is sufficient.\n\n" + json.dumps(payload, ensure_ascii=False)
|
| 175 |
+
try:
|
| 176 |
+
resp = client.chat.completions.create(
|
| 177 |
+
model=model,
|
| 178 |
+
messages=[
|
| 179 |
+
{"role": "system", "content": system_prompt},
|
| 180 |
+
{"role": "user", "content": user_prompt},
|
| 181 |
+
],
|
| 182 |
+
temperature=cfg.meta_judge_temperature,
|
| 183 |
+
max_tokens=cfg.meta_new_probe_max_tokens,
|
| 184 |
+
)
|
| 185 |
+
content = _safe_text(resp.choices[0].message.content)
|
| 186 |
+
obj = _parse_json_object(content)
|
| 187 |
+
if not obj:
|
| 188 |
+
return None
|
| 189 |
+
return {
|
| 190 |
+
"sufficient": bool(obj.get("sufficient", False)),
|
| 191 |
+
"confidence": float(obj.get("confidence", 0.0)),
|
| 192 |
+
"need_narrative": bool(obj.get("need_narrative", False)),
|
| 193 |
+
"missing": [str(x) for x in obj.get("missing", []) if str(x).strip()],
|
| 194 |
+
"next_probe": _safe_text(obj.get("next_probe")) or None,
|
| 195 |
+
}
|
| 196 |
+
except Exception:
|
| 197 |
+
return None
|
| 198 |
+
|
| 199 |
+
|
| 200 |
+
def _build_next_probe(
|
| 201 |
+
query: str,
|
| 202 |
+
assess: Dict,
|
| 203 |
+
previous_probes: List[str],
|
| 204 |
+
) -> Optional[str]:
|
| 205 |
+
probe = _safe_text(assess.get("next_probe"))
|
| 206 |
+
if probe:
|
| 207 |
+
if probe.lower() not in {p.lower() for p in previous_probes}:
|
| 208 |
+
return probe
|
| 209 |
+
missing = [str(x).strip() for x in assess.get("missing", []) if str(x).strip()]
|
| 210 |
+
if missing:
|
| 211 |
+
fallback = f"{query}. Focus on {', '.join(missing[:2])}."
|
| 212 |
+
if fallback.lower() not in {p.lower() for p in previous_probes}:
|
| 213 |
+
return fallback
|
| 214 |
+
return None
|
| 215 |
+
|
| 216 |
+
|
| 217 |
+
def run_meta_cognitive_qa(
|
| 218 |
+
query: str,
|
| 219 |
+
cfg: RuntimeConfig,
|
| 220 |
+
character: Optional[str] = None,
|
| 221 |
+
style_correct: bool = False,
|
| 222 |
+
max_iterations: Optional[int] = None,
|
| 223 |
+
) -> MetaLoopResult:
|
| 224 |
+
max_iter = int(max_iterations or cfg.meta_max_iterations)
|
| 225 |
+
pool: Dict[str, object] = {"facts": [], "persona": [], "worldview": [], "query_plan": {}}
|
| 226 |
+
trace: List[LoopStep] = []
|
| 227 |
+
probes: List[str] = [query]
|
| 228 |
+
|
| 229 |
+
for i in range(1, max_iter + 1):
|
| 230 |
+
probe = probes[-1]
|
| 231 |
+
retrieval = tri_retrieve(query=probe, cfg=cfg, character=character)
|
| 232 |
+
pool = _merge_evidence_pool(pool, retrieval)
|
| 233 |
+
|
| 234 |
+
assess = _llm_assess(query=query, character=character, pool=pool, cfg=cfg)
|
| 235 |
+
if assess is None:
|
| 236 |
+
assess = _heuristic_assess(pool=pool, cfg=cfg)
|
| 237 |
+
|
| 238 |
+
step = LoopStep(
|
| 239 |
+
iteration=i,
|
| 240 |
+
probe=probe,
|
| 241 |
+
sufficient=bool(assess.get("sufficient", False)),
|
| 242 |
+
confidence=float(assess.get("confidence", 0.0)),
|
| 243 |
+
missing=[str(x) for x in assess.get("missing", [])],
|
| 244 |
+
next_probe=_safe_text(assess.get("next_probe")) or None,
|
| 245 |
+
evidence_counts={
|
| 246 |
+
"facts": len(list(pool.get("facts", []))),
|
| 247 |
+
"persona": len(list(pool.get("persona", []))),
|
| 248 |
+
"worldview": len(list(pool.get("worldview", []))),
|
| 249 |
+
},
|
| 250 |
+
)
|
| 251 |
+
trace.append(step)
|
| 252 |
+
if step.sufficient:
|
| 253 |
+
break
|
| 254 |
+
|
| 255 |
+
next_probe = _build_next_probe(query=query, assess=assess, previous_probes=probes)
|
| 256 |
+
if not next_probe:
|
| 257 |
+
break
|
| 258 |
+
probes.append(next_probe)
|
| 259 |
+
|
| 260 |
+
# Keep decomposition aligned with original user query.
|
| 261 |
+
pool["query_plan"] = decompose_query(query=query, character=character)
|
| 262 |
+
answer = compose_response(
|
| 263 |
+
query=query,
|
| 264 |
+
evidence=pool,
|
| 265 |
+
cfg=cfg,
|
| 266 |
+
character=character,
|
| 267 |
+
style_correct=style_correct,
|
| 268 |
+
)
|
| 269 |
+
return MetaLoopResult(answer=answer, evidence=pool, trace=trace)
|
src/fic_agent/ingest/__init__.py
ADDED
|
File without changes
|
src/fic_agent/ingest/pipeline.py
ADDED
|
@@ -0,0 +1,494 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Ingestion pipeline: raw text -> chunks -> dialogue + metadata."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import json
|
| 6 |
+
import logging
|
| 7 |
+
import re
|
| 8 |
+
from dataclasses import dataclass
|
| 9 |
+
from typing import Iterable, Dict, List, Optional, Tuple
|
| 10 |
+
|
| 11 |
+
from ..utils.io import read_text
|
| 12 |
+
from ..config import RuntimeConfig
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
CHAPTER_PATTERNS = [
|
| 16 |
+
re.compile(r"^\s*chapter\s+([0-9]+|[ivx]+)\b.*$", re.IGNORECASE | re.MULTILINE),
|
| 17 |
+
]
|
| 18 |
+
|
| 19 |
+
QUOTE_PATTERNS = [
|
| 20 |
+
re.compile(r"“([^”]{1,400})”"),
|
| 21 |
+
re.compile(r"\"([^\"]{1,400})\""),
|
| 22 |
+
]
|
| 23 |
+
|
| 24 |
+
SPEECH_VERBS = r"said|asked|replied|cried|whispered|shouted|muttered|called|answered|remarked|continued|added"
|
| 25 |
+
|
| 26 |
+
SPEAKER_PATTERNS = [
|
| 27 |
+
# English: "Alice said" / "said Alice"
|
| 28 |
+
re.compile(
|
| 29 |
+
rf"(?P<speaker>[A-Z][a-z]+(?:\s+[A-Z][a-z]+)*)\s+(?:{SPEECH_VERBS})\b",
|
| 30 |
+
re.IGNORECASE,
|
| 31 |
+
),
|
| 32 |
+
re.compile(
|
| 33 |
+
rf"(?:{SPEECH_VERBS})\s+(?P<speaker>[A-Z][a-z]+(?:\s+[A-Z][a-z]+)*)\b",
|
| 34 |
+
re.IGNORECASE,
|
| 35 |
+
),
|
| 36 |
+
]
|
| 37 |
+
|
| 38 |
+
PRONOUN_PATTERN = re.compile(r"\b(he|she|him|her|his|hers)\b", re.IGNORECASE)
|
| 39 |
+
PRONOUN_SPEECH_PATTERN = re.compile(
|
| 40 |
+
rf"\b(he|she|him|her)\b.{{0,24}}\b(?:{SPEECH_VERBS})\b|\b(?:{SPEECH_VERBS})\b.{{0,24}}\b(he|she|him|her)\b",
|
| 41 |
+
re.IGNORECASE,
|
| 42 |
+
)
|
| 43 |
+
TITLE_ONLY = {"mr", "mrs", "miss", "ms", "dr", "sir", "madam", "lady"}
|
| 44 |
+
INVALID_SPEAKER_WORDS = {
|
| 45 |
+
"he",
|
| 46 |
+
"she",
|
| 47 |
+
"him",
|
| 48 |
+
"her",
|
| 49 |
+
"his",
|
| 50 |
+
"hers",
|
| 51 |
+
"they",
|
| 52 |
+
"them",
|
| 53 |
+
"their",
|
| 54 |
+
"my",
|
| 55 |
+
"your",
|
| 56 |
+
"our",
|
| 57 |
+
"the",
|
| 58 |
+
"visitor",
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
@dataclass
|
| 63 |
+
class ChunkRecord:
|
| 64 |
+
chunk_id: str
|
| 65 |
+
book_id: str
|
| 66 |
+
chapter_id: int
|
| 67 |
+
chapter_title: str
|
| 68 |
+
position: int
|
| 69 |
+
char_start: int
|
| 70 |
+
char_end: int
|
| 71 |
+
text: str
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
@dataclass
|
| 75 |
+
class DialogueRecord:
|
| 76 |
+
speaker: Optional[str]
|
| 77 |
+
speaker_method: Optional[str]
|
| 78 |
+
utterance: str
|
| 79 |
+
context_before: str
|
| 80 |
+
context_after: str
|
| 81 |
+
chunk_id: str
|
| 82 |
+
chapter_id: int
|
| 83 |
+
position: int
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def split_chapters(text: str) -> List[Tuple[str, str]]:
|
| 87 |
+
"""Split raw text into chapters.
|
| 88 |
+
|
| 89 |
+
Returns list of (chapter_title, chapter_text).
|
| 90 |
+
"""
|
| 91 |
+
if not text:
|
| 92 |
+
return [("chapter_0", "")]
|
| 93 |
+
|
| 94 |
+
matches: List[Tuple[int, int, str]] = []
|
| 95 |
+
for pat in CHAPTER_PATTERNS:
|
| 96 |
+
for m in pat.finditer(text):
|
| 97 |
+
matches.append((m.start(), m.end(), m.group(0).strip()))
|
| 98 |
+
|
| 99 |
+
if not matches:
|
| 100 |
+
return [("chapter_0", text)]
|
| 101 |
+
|
| 102 |
+
matches.sort(key=lambda x: x[0])
|
| 103 |
+
chapters: List[Tuple[str, str]] = []
|
| 104 |
+
for i, (start, end, title) in enumerate(matches):
|
| 105 |
+
next_start = matches[i + 1][0] if i + 1 < len(matches) else len(text)
|
| 106 |
+
chapter_text = text[end:next_start].strip()
|
| 107 |
+
chapters.append((title, chapter_text))
|
| 108 |
+
|
| 109 |
+
return chapters
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
def chunk_text(text: str, max_chars: int = 2000, overlap: int = 200) -> List[Tuple[str, int, int]]:
|
| 113 |
+
"""Chunk text by characters with optional overlap."""
|
| 114 |
+
if not text:
|
| 115 |
+
return []
|
| 116 |
+
if max_chars <= overlap:
|
| 117 |
+
raise ValueError("max_chars must be larger than overlap")
|
| 118 |
+
|
| 119 |
+
chunks: List[Tuple[str, int, int]] = []
|
| 120 |
+
step = max_chars - overlap
|
| 121 |
+
for start in range(0, len(text), step):
|
| 122 |
+
end = min(start + max_chars, len(text))
|
| 123 |
+
chunks.append((text[start:end], start, end))
|
| 124 |
+
if end == len(text):
|
| 125 |
+
break
|
| 126 |
+
return chunks
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
def build_document_layer(text: str, book_id: str, max_chars: int = 2000, overlap: int = 200) -> List[ChunkRecord]:
|
| 130 |
+
"""Build chunk records with chapter metadata."""
|
| 131 |
+
chapters = split_chapters(text)
|
| 132 |
+
records: List[ChunkRecord] = []
|
| 133 |
+
chunk_idx = 0
|
| 134 |
+
global_pos = 0
|
| 135 |
+
|
| 136 |
+
for chapter_id, (title, chapter_text) in enumerate(chapters):
|
| 137 |
+
for chunk_text_i, start, end in chunk_text(chapter_text, max_chars=max_chars, overlap=overlap):
|
| 138 |
+
record = ChunkRecord(
|
| 139 |
+
chunk_id=f"{book_id}-{chunk_idx}",
|
| 140 |
+
book_id=book_id,
|
| 141 |
+
chapter_id=chapter_id,
|
| 142 |
+
chapter_title=title,
|
| 143 |
+
position=global_pos,
|
| 144 |
+
char_start=start,
|
| 145 |
+
char_end=end,
|
| 146 |
+
text=chunk_text_i,
|
| 147 |
+
)
|
| 148 |
+
records.append(record)
|
| 149 |
+
chunk_idx += 1
|
| 150 |
+
global_pos += 1
|
| 151 |
+
|
| 152 |
+
return records
|
| 153 |
+
|
| 154 |
+
|
| 155 |
+
def _guess_speaker_rules(context_before: str, context_after: str) -> Optional[str]:
|
| 156 |
+
for pat in SPEAKER_PATTERNS:
|
| 157 |
+
m = pat.search(context_before)
|
| 158 |
+
if m:
|
| 159 |
+
speaker = m.groupdict().get("speaker")
|
| 160 |
+
if speaker and len(speaker) <= 64:
|
| 161 |
+
return speaker.strip()
|
| 162 |
+
m = pat.search(context_after)
|
| 163 |
+
if m:
|
| 164 |
+
speaker = m.groupdict().get("speaker")
|
| 165 |
+
if speaker and len(speaker) <= 64:
|
| 166 |
+
return speaker.strip()
|
| 167 |
+
|
| 168 |
+
return None
|
| 169 |
+
|
| 170 |
+
|
| 171 |
+
def _resolve_speaker_pronoun_rule(
|
| 172 |
+
context_before: str,
|
| 173 |
+
context_after: str,
|
| 174 |
+
candidates: List[str],
|
| 175 |
+
last_speaker: Optional[str],
|
| 176 |
+
recent_speakers: List[str],
|
| 177 |
+
) -> Optional[str]:
|
| 178 |
+
"""Resolve speaker when explicit name is absent but pronouns are present.
|
| 179 |
+
|
| 180 |
+
Rule priority:
|
| 181 |
+
1) If exactly one candidate name appears near quote, choose it.
|
| 182 |
+
2) If pronoun and speech-verb co-occur near quote, use last speaker.
|
| 183 |
+
3) Fallback to most recent known speaker.
|
| 184 |
+
"""
|
| 185 |
+
near = f"{context_before[-160:]} {context_after[:120]}".strip()
|
| 186 |
+
if not PRONOUN_PATTERN.search(near):
|
| 187 |
+
return None
|
| 188 |
+
|
| 189 |
+
mentioned = []
|
| 190 |
+
for c in candidates:
|
| 191 |
+
if re.search(rf"\b{re.escape(c)}\b", near):
|
| 192 |
+
mentioned.append(c)
|
| 193 |
+
if len(mentioned) == 1:
|
| 194 |
+
return mentioned[0]
|
| 195 |
+
|
| 196 |
+
local = f"{context_before[-90:]} {context_after[:90]}".strip()
|
| 197 |
+
if last_speaker and PRONOUN_SPEECH_PATTERN.search(local):
|
| 198 |
+
return last_speaker
|
| 199 |
+
|
| 200 |
+
if recent_speakers:
|
| 201 |
+
return recent_speakers[-1]
|
| 202 |
+
|
| 203 |
+
return None
|
| 204 |
+
|
| 205 |
+
|
| 206 |
+
def _fallback_speaker_name(context: str) -> Optional[str]:
|
| 207 |
+
m = re.search(r"\b([A-Z][a-z]+(?:\s+[A-Z][a-z]+)*)\b", context)
|
| 208 |
+
if m:
|
| 209 |
+
return m.group(1).strip()
|
| 210 |
+
return None
|
| 211 |
+
|
| 212 |
+
|
| 213 |
+
def _extract_candidate_names(context: str) -> List[str]:
|
| 214 |
+
candidates = re.findall(r"\b([A-Z][a-z]+(?:\s+[A-Z][a-z]+)*)\b", context)
|
| 215 |
+
# de-duplicate, preserve order
|
| 216 |
+
seen = set()
|
| 217 |
+
ordered = []
|
| 218 |
+
for c in candidates:
|
| 219 |
+
if c not in seen:
|
| 220 |
+
ordered.append(c)
|
| 221 |
+
seen.add(c)
|
| 222 |
+
return ordered[:10]
|
| 223 |
+
|
| 224 |
+
|
| 225 |
+
def _speaker_norm_key(name: str) -> str:
|
| 226 |
+
cleaned = re.sub(r"[^A-Za-z\s\.]", " ", name)
|
| 227 |
+
cleaned = re.sub(r"\s+", " ", cleaned).strip().lower()
|
| 228 |
+
words = [w.strip(".") for w in cleaned.split() if w.strip(".")]
|
| 229 |
+
if words and words[0] in TITLE_ONLY:
|
| 230 |
+
words = words[1:]
|
| 231 |
+
return " ".join(words)
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
def _normalize_speaker(
|
| 235 |
+
raw: Optional[str],
|
| 236 |
+
candidates: List[str],
|
| 237 |
+
cfg: Optional[RuntimeConfig] = None,
|
| 238 |
+
) -> Optional[str]:
|
| 239 |
+
if not raw:
|
| 240 |
+
return None
|
| 241 |
+
|
| 242 |
+
val = re.sub(r"\s+", " ", raw.strip().strip("\"'")).strip()
|
| 243 |
+
if not val:
|
| 244 |
+
return None
|
| 245 |
+
words = [w.strip(".").lower() for w in val.split()]
|
| 246 |
+
if not words:
|
| 247 |
+
return None
|
| 248 |
+
if len(words) == 1 and words[0] in TITLE_ONLY:
|
| 249 |
+
return None
|
| 250 |
+
if words[0] in {"my", "your", "our", "their", "his", "her"}:
|
| 251 |
+
return None
|
| 252 |
+
if any(w in INVALID_SPEAKER_WORDS for w in words):
|
| 253 |
+
# If candidate list exists and can map, allow mapping below.
|
| 254 |
+
pass
|
| 255 |
+
|
| 256 |
+
if candidates:
|
| 257 |
+
cand_map: Dict[str, str] = {}
|
| 258 |
+
for c in candidates:
|
| 259 |
+
key = _speaker_norm_key(c)
|
| 260 |
+
if key:
|
| 261 |
+
cand_map[key] = c
|
| 262 |
+
val_key = _speaker_norm_key(val)
|
| 263 |
+
if val_key in cand_map:
|
| 264 |
+
return cand_map[val_key]
|
| 265 |
+
# token-level fallback: map "utterson" -> "Utterson"
|
| 266 |
+
if val_key:
|
| 267 |
+
val_tokens = set(val_key.split())
|
| 268 |
+
for k, c in cand_map.items():
|
| 269 |
+
k_tokens = set(k.split())
|
| 270 |
+
if val_tokens and (val_tokens <= k_tokens or k_tokens <= val_tokens):
|
| 271 |
+
return c
|
| 272 |
+
if cfg and cfg.speaker_strict_candidates:
|
| 273 |
+
return None
|
| 274 |
+
|
| 275 |
+
# no candidates or non-strict mode: return cleaned proper noun only
|
| 276 |
+
if not re.search(r"[A-Z]", val):
|
| 277 |
+
return None
|
| 278 |
+
if len(val.split()) > 4:
|
| 279 |
+
return None
|
| 280 |
+
if _speaker_norm_key(val) in INVALID_SPEAKER_WORDS:
|
| 281 |
+
return None
|
| 282 |
+
return val
|
| 283 |
+
|
| 284 |
+
|
| 285 |
+
def _parse_json_object(text: str) -> Optional[Dict]:
|
| 286 |
+
if not text:
|
| 287 |
+
return None
|
| 288 |
+
try:
|
| 289 |
+
return json.loads(text)
|
| 290 |
+
except json.JSONDecodeError:
|
| 291 |
+
pass
|
| 292 |
+
# try to extract a JSON object from text
|
| 293 |
+
start = text.find("{")
|
| 294 |
+
end = text.rfind("}")
|
| 295 |
+
if start != -1 and end != -1 and end > start:
|
| 296 |
+
try:
|
| 297 |
+
return json.loads(text[start : end + 1])
|
| 298 |
+
except json.JSONDecodeError:
|
| 299 |
+
return None
|
| 300 |
+
return None
|
| 301 |
+
|
| 302 |
+
|
| 303 |
+
def _resolve_speaker_llm(
|
| 304 |
+
utterance: str,
|
| 305 |
+
context_before: str,
|
| 306 |
+
context_after: str,
|
| 307 |
+
candidates: List[str],
|
| 308 |
+
last_speaker: Optional[str],
|
| 309 |
+
recent_speakers: List[str],
|
| 310 |
+
cfg: RuntimeConfig,
|
| 311 |
+
) -> Optional[str]:
|
| 312 |
+
if not cfg.llm_api_key or not cfg.speaker_llm_enabled:
|
| 313 |
+
return None
|
| 314 |
+
|
| 315 |
+
try:
|
| 316 |
+
from openai import OpenAI
|
| 317 |
+
except Exception as e:
|
| 318 |
+
logging.warning("OpenAI client unavailable for speaker resolution: %s", e)
|
| 319 |
+
return None
|
| 320 |
+
|
| 321 |
+
client = OpenAI(base_url=cfg.llm_base_url, api_key=cfg.llm_api_key)
|
| 322 |
+
model = cfg.speaker_llm_model or cfg.llm_model
|
| 323 |
+
|
| 324 |
+
candidate_str = ", ".join(candidates) if candidates else "Unknown"
|
| 325 |
+
recent_str = ", ".join(recent_speakers[-3:]) if recent_speakers else "None"
|
| 326 |
+
last_str = last_speaker if last_speaker else "Unknown"
|
| 327 |
+
system_prompt = (
|
| 328 |
+
"You identify who is speaking in a novel quote. "
|
| 329 |
+
"Use the provided candidate list if available. "
|
| 330 |
+
"Use pronoun coreference with context and prior turns when explicit names are absent. "
|
| 331 |
+
"Do not output pronouns or generic noun phrases. "
|
| 332 |
+
"Return a JSON object with keys: speaker, confidence, reason."
|
| 333 |
+
)
|
| 334 |
+
user_prompt = (
|
| 335 |
+
f"Quote:\n\"{utterance}\"\n\n"
|
| 336 |
+
f"Context before:\n{context_before}\n\n"
|
| 337 |
+
f"Context after:\n{context_after}\n\n"
|
| 338 |
+
f"Candidates: {candidate_str}\n\n"
|
| 339 |
+
f"Last speaker: {last_str}\n"
|
| 340 |
+
f"Recent speakers: {recent_str}\n\n"
|
| 341 |
+
"If you are unsure, set speaker to Unknown."
|
| 342 |
+
)
|
| 343 |
+
|
| 344 |
+
try:
|
| 345 |
+
if cfg.api_progress:
|
| 346 |
+
short = utterance.replace("\n", " ")[:80]
|
| 347 |
+
print(f"[speaker-llm] resolving speaker for: \"{short}...\"", flush=True)
|
| 348 |
+
resp = client.chat.completions.create(
|
| 349 |
+
model=model,
|
| 350 |
+
messages=[
|
| 351 |
+
{"role": "system", "content": system_prompt},
|
| 352 |
+
{"role": "user", "content": user_prompt},
|
| 353 |
+
],
|
| 354 |
+
temperature=cfg.speaker_llm_temperature,
|
| 355 |
+
max_tokens=cfg.speaker_llm_max_tokens,
|
| 356 |
+
)
|
| 357 |
+
content = resp.choices[0].message.content
|
| 358 |
+
obj = _parse_json_object(content)
|
| 359 |
+
if not obj:
|
| 360 |
+
return None
|
| 361 |
+
speaker = obj.get("speaker")
|
| 362 |
+
if not speaker:
|
| 363 |
+
return None
|
| 364 |
+
if speaker.lower() == "unknown":
|
| 365 |
+
return None
|
| 366 |
+
normalized = _normalize_speaker(speaker, candidates, cfg=cfg)
|
| 367 |
+
return normalized
|
| 368 |
+
except Exception as e:
|
| 369 |
+
logging.warning("LLM speaker resolution failed: %s", e)
|
| 370 |
+
return None
|
| 371 |
+
|
| 372 |
+
|
| 373 |
+
def extract_dialogue(
|
| 374 |
+
chunks: Iterable[ChunkRecord],
|
| 375 |
+
cfg: Optional[RuntimeConfig] = None,
|
| 376 |
+
character_candidates: Optional[List[str]] = None,
|
| 377 |
+
) -> List[DialogueRecord]:
|
| 378 |
+
"""Extract dialogue from chunk records.
|
| 379 |
+
|
| 380 |
+
Returns:
|
| 381 |
+
List of DialogueRecord with speaker guess and context.
|
| 382 |
+
"""
|
| 383 |
+
results: List[DialogueRecord] = []
|
| 384 |
+
last_speaker: Optional[str] = None
|
| 385 |
+
recent_speakers: List[str] = []
|
| 386 |
+
|
| 387 |
+
for chunk in chunks:
|
| 388 |
+
text = chunk.text
|
| 389 |
+
for pat in QUOTE_PATTERNS:
|
| 390 |
+
for m in pat.finditer(text):
|
| 391 |
+
utterance = m.group(1).strip()
|
| 392 |
+
if not utterance:
|
| 393 |
+
continue
|
| 394 |
+
start, end = m.span(1)
|
| 395 |
+
context_before = text[max(0, start - 120) : start].strip()
|
| 396 |
+
context_after = text[end : min(len(text), end + 120)].strip()
|
| 397 |
+
speaker = _guess_speaker_rules(context_before, context_after)
|
| 398 |
+
candidates = character_candidates or _extract_candidate_names(
|
| 399 |
+
f"{context_before} {context_after}"
|
| 400 |
+
)
|
| 401 |
+
speaker = _normalize_speaker(speaker, candidates, cfg=cfg)
|
| 402 |
+
speaker_method = "rule" if speaker else None
|
| 403 |
+
|
| 404 |
+
if not speaker and cfg:
|
| 405 |
+
speaker = _resolve_speaker_pronoun_rule(
|
| 406 |
+
context_before=context_before,
|
| 407 |
+
context_after=context_after,
|
| 408 |
+
candidates=candidates,
|
| 409 |
+
last_speaker=last_speaker,
|
| 410 |
+
recent_speakers=recent_speakers,
|
| 411 |
+
)
|
| 412 |
+
speaker = _normalize_speaker(speaker, candidates, cfg=cfg)
|
| 413 |
+
if speaker:
|
| 414 |
+
speaker_method = "pronoun_rule"
|
| 415 |
+
|
| 416 |
+
if not speaker and cfg:
|
| 417 |
+
speaker = _resolve_speaker_llm(
|
| 418 |
+
utterance=utterance,
|
| 419 |
+
context_before=context_before,
|
| 420 |
+
context_after=context_after,
|
| 421 |
+
candidates=candidates,
|
| 422 |
+
last_speaker=last_speaker,
|
| 423 |
+
recent_speakers=recent_speakers,
|
| 424 |
+
cfg=cfg,
|
| 425 |
+
)
|
| 426 |
+
if speaker:
|
| 427 |
+
speaker_method = "llm"
|
| 428 |
+
|
| 429 |
+
if not speaker:
|
| 430 |
+
speaker = _fallback_speaker_name(f"{context_before} {context_after}")
|
| 431 |
+
speaker = _normalize_speaker(speaker, candidates, cfg=cfg)
|
| 432 |
+
speaker_method = "heuristic" if speaker else None
|
| 433 |
+
|
| 434 |
+
results.append(
|
| 435 |
+
DialogueRecord(
|
| 436 |
+
speaker=speaker,
|
| 437 |
+
speaker_method=speaker_method,
|
| 438 |
+
utterance=utterance,
|
| 439 |
+
context_before=context_before,
|
| 440 |
+
context_after=context_after,
|
| 441 |
+
chunk_id=chunk.chunk_id,
|
| 442 |
+
chapter_id=chunk.chapter_id,
|
| 443 |
+
position=chunk.position,
|
| 444 |
+
)
|
| 445 |
+
)
|
| 446 |
+
if speaker:
|
| 447 |
+
last_speaker = speaker
|
| 448 |
+
recent_speakers.append(speaker)
|
| 449 |
+
if len(recent_speakers) > 20:
|
| 450 |
+
recent_speakers = recent_speakers[-20:]
|
| 451 |
+
|
| 452 |
+
return results
|
| 453 |
+
|
| 454 |
+
|
| 455 |
+
def load_text_file(path: str) -> str:
|
| 456 |
+
return read_text(path)
|
| 457 |
+
|
| 458 |
+
|
| 459 |
+
def save_jsonl(records: Iterable[Dict], path: str) -> None:
|
| 460 |
+
with open(path, "w", encoding="utf-8") as f:
|
| 461 |
+
for r in records:
|
| 462 |
+
f.write(json.dumps(r, ensure_ascii=False) + "\n")
|
| 463 |
+
|
| 464 |
+
|
| 465 |
+
def chunks_to_dicts(records: Iterable[ChunkRecord]) -> List[Dict]:
|
| 466 |
+
return [
|
| 467 |
+
{
|
| 468 |
+
"chunk_id": r.chunk_id,
|
| 469 |
+
"book_id": r.book_id,
|
| 470 |
+
"chapter_id": r.chapter_id,
|
| 471 |
+
"chapter_title": r.chapter_title,
|
| 472 |
+
"position": r.position,
|
| 473 |
+
"char_start": r.char_start,
|
| 474 |
+
"char_end": r.char_end,
|
| 475 |
+
"text": r.text,
|
| 476 |
+
}
|
| 477 |
+
for r in records
|
| 478 |
+
]
|
| 479 |
+
|
| 480 |
+
|
| 481 |
+
def dialogues_to_dicts(records: Iterable[DialogueRecord]) -> List[Dict]:
|
| 482 |
+
return [
|
| 483 |
+
{
|
| 484 |
+
"speaker": r.speaker,
|
| 485 |
+
"speaker_method": r.speaker_method,
|
| 486 |
+
"utterance": r.utterance,
|
| 487 |
+
"context_before": r.context_before,
|
| 488 |
+
"context_after": r.context_after,
|
| 489 |
+
"chunk_id": r.chunk_id,
|
| 490 |
+
"chapter_id": r.chapter_id,
|
| 491 |
+
"position": r.position,
|
| 492 |
+
}
|
| 493 |
+
for r in records
|
| 494 |
+
]
|
src/fic_agent/persona/__init__.py
ADDED
|
File without changes
|
src/fic_agent/persona/profile.py
ADDED
|
@@ -0,0 +1,443 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Persona profile schema and builder."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from dataclasses import dataclass, asdict
|
| 6 |
+
from collections import Counter
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
from string import Template
|
| 9 |
+
from typing import Dict, List, Optional
|
| 10 |
+
import math
|
| 11 |
+
import json
|
| 12 |
+
import re
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
EMOTION_LEXICON = {
|
| 16 |
+
"joy": {"happy", "joy", "smile", "laugh", "delight", "glad", "pleased", "cheerful"},
|
| 17 |
+
"sadness": {"sad", "cry", "tears", "sorrow", "grief", "mourn", "miserable"},
|
| 18 |
+
"anger": {"angry", "rage", "furious", "hate", "damn", "wrath", "foul"},
|
| 19 |
+
"fear": {"fear", "afraid", "scared", "panic", "terror", "dread", "frightened"},
|
| 20 |
+
"trust": {"trust", "faith", "believe", "rely", "sure", "certain"},
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
PUNCTUATION = ["!", "?", "...", ",", "."]
|
| 24 |
+
|
| 25 |
+
# Compact English stopword list for style-marker filtering.
|
| 26 |
+
STOPWORDS = {
|
| 27 |
+
"a", "about", "above", "after", "again", "against", "all", "am", "an", "and",
|
| 28 |
+
"any", "are", "as", "at", "be", "because", "been", "before", "being", "below",
|
| 29 |
+
"between", "both", "but", "by", "can", "could", "did", "do", "does", "doing",
|
| 30 |
+
"down", "during", "each", "few", "for", "from", "further", "had", "has", "have",
|
| 31 |
+
"having", "he", "her", "here", "hers", "herself", "him", "himself", "his", "how",
|
| 32 |
+
"i", "if", "in", "into", "is", "it", "its", "itself", "just", "me", "more", "most",
|
| 33 |
+
"my", "myself", "no", "nor", "not", "now", "of", "off", "on", "once", "only", "or",
|
| 34 |
+
"other", "our", "ours", "ourselves", "out", "over", "own", "same", "she", "should",
|
| 35 |
+
"so", "some", "such", "than", "that", "the", "their", "theirs", "them", "themselves",
|
| 36 |
+
"then", "there", "these", "they", "this", "those", "through", "to", "too", "under",
|
| 37 |
+
"until", "up", "very", "was", "we", "were", "what", "when", "where", "which", "while",
|
| 38 |
+
"who", "whom", "why", "with", "would", "you", "your", "yours", "yourself", "yourselves",
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
PRONOUN_LIKE = {
|
| 42 |
+
"he", "she", "they", "we", "i", "you", "me", "him", "her", "them", "us",
|
| 43 |
+
"my", "your", "his", "its", "our", "their", "mine", "yours", "hers", "ours", "theirs",
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
TITLE_WORDS = {"mr", "mrs", "ms", "dr", "sir", "madam", "miss"}
|
| 47 |
+
CONTRACTION_SUFFIXES = {"s", "t", "ll", "ve", "re", "d", "m"}
|
| 48 |
+
WEAK_STYLE_WORDS = {
|
| 49 |
+
"like", "know", "well", "say", "said", "see", "think", "tell", "come", "go",
|
| 50 |
+
"look", "want", "get", "make", "take", "give", "let", "yes", "yeah", "no",
|
| 51 |
+
"right", "really", "quite", "just", "thing", "things", "man", "men", "woman",
|
| 52 |
+
"women", "people", "time", "day", "night",
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
VALUE_LEXICON = {
|
| 56 |
+
"duty_and_order": {
|
| 57 |
+
"must", "should", "ought", "duty", "responsibility", "obey", "law", "proper", "order",
|
| 58 |
+
},
|
| 59 |
+
"truth_and_honesty": {
|
| 60 |
+
"truth", "honest", "honesty", "lie", "confess", "confession", "frank", "plainly",
|
| 61 |
+
},
|
| 62 |
+
"justice_and_morality": {
|
| 63 |
+
"right", "wrong", "justice", "guilty", "innocent", "sin", "evil", "crime", "moral",
|
| 64 |
+
},
|
| 65 |
+
"care_and_compassion": {
|
| 66 |
+
"care", "kind", "help", "protect", "mercy", "forgive", "gentle", "pity", "love",
|
| 67 |
+
},
|
| 68 |
+
"self_preservation": {
|
| 69 |
+
"safe", "danger", "dangerous", "risk", "hide", "escape", "protect", "survive",
|
| 70 |
+
},
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
EMOTION_LABELS = {
|
| 74 |
+
"joy": "joy_or_optimism",
|
| 75 |
+
"sadness": "sadness_or_grief",
|
| 76 |
+
"anger": "anger_or_frustration",
|
| 77 |
+
"fear": "fear_or_anxiety",
|
| 78 |
+
"trust": "trust_or_assurance",
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
VALUE_LABELS = {
|
| 82 |
+
"duty_and_order": "duty_and_order",
|
| 83 |
+
"truth_and_honesty": "truth_and_honesty",
|
| 84 |
+
"justice_and_morality": "justice_and_morality",
|
| 85 |
+
"care_and_compassion": "care_and_compassion",
|
| 86 |
+
"self_preservation": "self_preservation",
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
@dataclass
|
| 91 |
+
class PersonaProfile:
|
| 92 |
+
name: str
|
| 93 |
+
style_markers: List[str]
|
| 94 |
+
emotion_tendencies: List[str]
|
| 95 |
+
values: List[str]
|
| 96 |
+
worldview_notes: List[str]
|
| 97 |
+
speaking_rules: List[str]
|
| 98 |
+
stats: Dict[str, float]
|
| 99 |
+
examples: List[str]
|
| 100 |
+
|
| 101 |
+
def to_dict(self) -> Dict:
|
| 102 |
+
return asdict(self)
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
def _tokenize(text: str) -> List[str]:
|
| 106 |
+
# Extract English words
|
| 107 |
+
tokens = re.findall(r"[A-Za-z']+", text)
|
| 108 |
+
normalized: List[str] = []
|
| 109 |
+
for t in tokens:
|
| 110 |
+
v = t.lower().strip("'")
|
| 111 |
+
if not v:
|
| 112 |
+
continue
|
| 113 |
+
if v.endswith("'s"):
|
| 114 |
+
v = v[:-2]
|
| 115 |
+
if v in CONTRACTION_SUFFIXES:
|
| 116 |
+
continue
|
| 117 |
+
normalized.append(v)
|
| 118 |
+
return normalized
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
def _normalize_terms_to_tokens(terms: List[str] | None) -> set[str]:
|
| 122 |
+
if not terms:
|
| 123 |
+
return set()
|
| 124 |
+
out: set[str] = set()
|
| 125 |
+
for term in terms:
|
| 126 |
+
for tok in _tokenize(term):
|
| 127 |
+
if tok:
|
| 128 |
+
out.add(tok)
|
| 129 |
+
return out
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
def _is_informative_token(token: str, banned_terms: set[str] | None = None) -> bool:
|
| 133 |
+
if len(token) < 3:
|
| 134 |
+
return False
|
| 135 |
+
if token in STOPWORDS or token in PRONOUN_LIKE or token in TITLE_WORDS:
|
| 136 |
+
return False
|
| 137 |
+
if token in WEAK_STYLE_WORDS:
|
| 138 |
+
return False
|
| 139 |
+
if banned_terms and token in banned_terms:
|
| 140 |
+
return False
|
| 141 |
+
if re.fullmatch(r"\d+", token):
|
| 142 |
+
return False
|
| 143 |
+
return True
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
def _collect_ngram_counts(token_lines: List[List[str]], n: int, banned_terms: set[str] | None = None) -> Counter:
|
| 147 |
+
counts: Counter = Counter()
|
| 148 |
+
for line in token_lines:
|
| 149 |
+
if len(line) < n:
|
| 150 |
+
continue
|
| 151 |
+
for i in range(len(line) - n + 1):
|
| 152 |
+
gram = line[i : i + n]
|
| 153 |
+
informative_count = sum(1 for t in gram if _is_informative_token(t, banned_terms=banned_terms))
|
| 154 |
+
if informative_count == 0:
|
| 155 |
+
continue
|
| 156 |
+
# Avoid fully generic stopword-ish phrases.
|
| 157 |
+
if informative_count < max(1, n - 1):
|
| 158 |
+
continue
|
| 159 |
+
if banned_terms and any(t in banned_terms for t in gram):
|
| 160 |
+
continue
|
| 161 |
+
counts[" ".join(gram)] += 1
|
| 162 |
+
return counts
|
| 163 |
+
|
| 164 |
+
|
| 165 |
+
def _rank_distinctive_terms(
|
| 166 |
+
target_counts: Counter,
|
| 167 |
+
background_counts: Counter,
|
| 168 |
+
min_freq: int,
|
| 169 |
+
top_n: int,
|
| 170 |
+
weight: float = 1.0,
|
| 171 |
+
) -> List[tuple[str, float]]:
|
| 172 |
+
if not target_counts:
|
| 173 |
+
return []
|
| 174 |
+
|
| 175 |
+
target_total = max(1, sum(target_counts.values()))
|
| 176 |
+
background_total = max(1, sum(background_counts.values()))
|
| 177 |
+
|
| 178 |
+
scored: List[tuple[str, float]] = []
|
| 179 |
+
for term, freq in target_counts.items():
|
| 180 |
+
if freq < min_freq:
|
| 181 |
+
continue
|
| 182 |
+
tf = freq / target_total
|
| 183 |
+
bg = background_counts.get(term, 0)
|
| 184 |
+
# Distinctiveness against other characters: higher when absent in background.
|
| 185 |
+
idf = math.log((background_total + 10.0) / (bg + 1.0))
|
| 186 |
+
score = tf * idf * weight
|
| 187 |
+
if score <= 0:
|
| 188 |
+
continue
|
| 189 |
+
scored.append((term, score))
|
| 190 |
+
|
| 191 |
+
scored.sort(key=lambda x: x[1], reverse=True)
|
| 192 |
+
return scored[:top_n]
|
| 193 |
+
|
| 194 |
+
|
| 195 |
+
def _extract_style_markers(
|
| 196 |
+
utterances: List[str],
|
| 197 |
+
background_utterances: List[str] | None = None,
|
| 198 |
+
excluded_terms: List[str] | None = None,
|
| 199 |
+
top_n: int = 20,
|
| 200 |
+
) -> List[str]:
|
| 201 |
+
banned_terms = _normalize_terms_to_tokens(excluded_terms)
|
| 202 |
+
target_tokens_per_line = [_tokenize(u) for u in utterances]
|
| 203 |
+
target_tokens = [t for line in target_tokens_per_line for t in line]
|
| 204 |
+
target_uni = Counter(t for t in target_tokens if _is_informative_token(t, banned_terms=banned_terms))
|
| 205 |
+
|
| 206 |
+
bg_utterances = background_utterances or []
|
| 207 |
+
bg_tokens_per_line = [_tokenize(u) for u in bg_utterances]
|
| 208 |
+
bg_tokens = [t for line in bg_tokens_per_line for t in line]
|
| 209 |
+
bg_uni = Counter(t for t in bg_tokens if _is_informative_token(t, banned_terms=banned_terms))
|
| 210 |
+
|
| 211 |
+
target_bi = _collect_ngram_counts(target_tokens_per_line, n=2, banned_terms=banned_terms)
|
| 212 |
+
bg_bi = _collect_ngram_counts(bg_tokens_per_line, n=2, banned_terms=banned_terms)
|
| 213 |
+
|
| 214 |
+
uni_ranked = _rank_distinctive_terms(target_uni, bg_uni, min_freq=2, top_n=top_n * 3, weight=1.0)
|
| 215 |
+
bi_ranked = _rank_distinctive_terms(target_bi, bg_bi, min_freq=1, top_n=top_n * 2, weight=1.2)
|
| 216 |
+
|
| 217 |
+
merged = uni_ranked + bi_ranked
|
| 218 |
+
merged.sort(key=lambda x: x[1], reverse=True)
|
| 219 |
+
|
| 220 |
+
markers: List[str] = []
|
| 221 |
+
seen = set()
|
| 222 |
+
for term, _ in merged:
|
| 223 |
+
if term in seen:
|
| 224 |
+
continue
|
| 225 |
+
seen.add(term)
|
| 226 |
+
markers.append(term)
|
| 227 |
+
if len(markers) >= top_n:
|
| 228 |
+
break
|
| 229 |
+
|
| 230 |
+
if markers:
|
| 231 |
+
return markers
|
| 232 |
+
|
| 233 |
+
# Last-resort fallback to keep prompt non-empty for tiny datasets.
|
| 234 |
+
fallback = [t for t, _ in target_uni.most_common(top_n)]
|
| 235 |
+
return fallback
|
| 236 |
+
|
| 237 |
+
|
| 238 |
+
def _rank_weighted_categories(
|
| 239 |
+
tokens: List[str],
|
| 240 |
+
category_lexicon: Dict[str, set[str]],
|
| 241 |
+
label_map: Optional[Dict[str, str]] = None,
|
| 242 |
+
top_n: int = 3,
|
| 243 |
+
) -> List[str]:
|
| 244 |
+
if not tokens:
|
| 245 |
+
return []
|
| 246 |
+
counts = Counter(tokens)
|
| 247 |
+
token_total = max(1, len(tokens))
|
| 248 |
+
scores: List[tuple[str, float]] = []
|
| 249 |
+
for category, lex in category_lexicon.items():
|
| 250 |
+
hit_count = sum(counts.get(w, 0) for w in lex)
|
| 251 |
+
if hit_count <= 0:
|
| 252 |
+
continue
|
| 253 |
+
# Normalized by token volume to avoid always favoring verbose speakers.
|
| 254 |
+
score = hit_count / token_total
|
| 255 |
+
scores.append((category, score))
|
| 256 |
+
if not scores:
|
| 257 |
+
return []
|
| 258 |
+
scores.sort(key=lambda x: x[1], reverse=True)
|
| 259 |
+
labels = label_map or {}
|
| 260 |
+
return [labels.get(k, k) for k, _ in scores[:top_n]]
|
| 261 |
+
|
| 262 |
+
|
| 263 |
+
def _select_representative_examples(utterances: List[str], top_n: int = 5) -> List[str]:
|
| 264 |
+
if not utterances:
|
| 265 |
+
return []
|
| 266 |
+
|
| 267 |
+
scored: List[tuple[float, str]] = []
|
| 268 |
+
seen_norm = set()
|
| 269 |
+
for u in utterances:
|
| 270 |
+
normalized = re.sub(r"\s+", " ", u.strip()).lower()
|
| 271 |
+
if not normalized or normalized in seen_norm:
|
| 272 |
+
continue
|
| 273 |
+
seen_norm.add(normalized)
|
| 274 |
+
|
| 275 |
+
toks = _tokenize(u)
|
| 276 |
+
if len(toks) < 4:
|
| 277 |
+
continue
|
| 278 |
+
length = len(u)
|
| 279 |
+
diversity = len(set(toks)) / max(1, len(toks))
|
| 280 |
+
punct_bonus = 0.0
|
| 281 |
+
punct_bonus += 0.06 if "?" in u else 0.0
|
| 282 |
+
punct_bonus += 0.05 if "!" in u else 0.0
|
| 283 |
+
# Prefer medium-length, semantically denser lines.
|
| 284 |
+
length_penalty = abs(length - 110) / 220.0
|
| 285 |
+
score = diversity + punct_bonus - length_penalty
|
| 286 |
+
scored.append((score, u.strip()))
|
| 287 |
+
|
| 288 |
+
if not scored:
|
| 289 |
+
return [u.strip() for u in utterances[:top_n]]
|
| 290 |
+
|
| 291 |
+
scored.sort(key=lambda x: x[0], reverse=True)
|
| 292 |
+
examples: List[str] = []
|
| 293 |
+
used_token_sets: List[set[str]] = []
|
| 294 |
+
for _, line in scored:
|
| 295 |
+
token_set = set(_tokenize(line))
|
| 296 |
+
if not token_set:
|
| 297 |
+
continue
|
| 298 |
+
too_similar = False
|
| 299 |
+
for prev in used_token_sets:
|
| 300 |
+
overlap = len(token_set & prev) / max(1, len(token_set | prev))
|
| 301 |
+
if overlap > 0.72:
|
| 302 |
+
too_similar = True
|
| 303 |
+
break
|
| 304 |
+
if too_similar:
|
| 305 |
+
continue
|
| 306 |
+
examples.append(line)
|
| 307 |
+
used_token_sets.append(token_set)
|
| 308 |
+
if len(examples) >= top_n:
|
| 309 |
+
break
|
| 310 |
+
|
| 311 |
+
if examples:
|
| 312 |
+
return examples
|
| 313 |
+
return [u.strip() for u in utterances[:top_n]]
|
| 314 |
+
|
| 315 |
+
|
| 316 |
+
def _build_speaking_rules(
|
| 317 |
+
utterances: List[str],
|
| 318 |
+
punct_counts: Counter,
|
| 319 |
+
avg_len: float,
|
| 320 |
+
tokens: List[str],
|
| 321 |
+
) -> List[str]:
|
| 322 |
+
rules: List[str] = []
|
| 323 |
+
utter_n = max(1, len(utterances))
|
| 324 |
+
if punct_counts.get("?", 0) / utter_n > 0.3:
|
| 325 |
+
rules.append("Often asks questions.")
|
| 326 |
+
if punct_counts.get("!", 0) / utter_n > 0.3:
|
| 327 |
+
rules.append("Uses exclamations frequently.")
|
| 328 |
+
if punct_counts.get("...", 0) / utter_n > 0.2:
|
| 329 |
+
rules.append("Uses ellipses to trail off.")
|
| 330 |
+
if avg_len < 60:
|
| 331 |
+
rules.append("Prefers short sentences.")
|
| 332 |
+
elif avg_len > 120:
|
| 333 |
+
rules.append("Prefers long sentences.")
|
| 334 |
+
|
| 335 |
+
lower_tokens = [t.lower() for t in tokens]
|
| 336 |
+
modal_count = sum(1 for t in lower_tokens if t in {"must", "should", "ought", "may", "might"})
|
| 337 |
+
hedge_count = sum(1 for t in lower_tokens if t in {"perhaps", "maybe", "seems", "suppose", "likely"})
|
| 338 |
+
if modal_count / max(1, len(lower_tokens)) > 0.03:
|
| 339 |
+
rules.append("Uses modal verbs to express obligation or uncertainty.")
|
| 340 |
+
if hedge_count / max(1, len(lower_tokens)) > 0.02:
|
| 341 |
+
rules.append("Hedges statements with cautious wording.")
|
| 342 |
+
|
| 343 |
+
return rules
|
| 344 |
+
|
| 345 |
+
|
| 346 |
+
def build_persona_profile(
|
| 347 |
+
name: str,
|
| 348 |
+
utterances: List[str],
|
| 349 |
+
background_utterances: List[str] | None = None,
|
| 350 |
+
excluded_terms: List[str] | None = None,
|
| 351 |
+
worldview_notes: Optional[List[str]] = None,
|
| 352 |
+
top_n: int = 20,
|
| 353 |
+
) -> PersonaProfile:
|
| 354 |
+
"""Build persona profile from utterances using simple statistics."""
|
| 355 |
+
tokens: List[str] = []
|
| 356 |
+
lengths: List[int] = []
|
| 357 |
+
punct_counts = Counter()
|
| 358 |
+
emotion_tokens: List[str] = []
|
| 359 |
+
value_tokens: List[str] = []
|
| 360 |
+
|
| 361 |
+
for u in utterances:
|
| 362 |
+
lengths.append(len(u))
|
| 363 |
+
cur_tokens = _tokenize(u)
|
| 364 |
+
tokens.extend(cur_tokens)
|
| 365 |
+
emotion_tokens.extend(cur_tokens)
|
| 366 |
+
value_tokens.extend(cur_tokens)
|
| 367 |
+
for p in PUNCTUATION:
|
| 368 |
+
if p in u:
|
| 369 |
+
punct_counts[p] += u.count(p)
|
| 370 |
+
|
| 371 |
+
token_counts = Counter(tokens)
|
| 372 |
+
style_markers = _extract_style_markers(
|
| 373 |
+
utterances,
|
| 374 |
+
background_utterances=background_utterances,
|
| 375 |
+
excluded_terms=excluded_terms,
|
| 376 |
+
top_n=top_n,
|
| 377 |
+
)
|
| 378 |
+
emotion_tendencies = _rank_weighted_categories(
|
| 379 |
+
emotion_tokens, EMOTION_LEXICON, label_map=EMOTION_LABELS, top_n=3
|
| 380 |
+
)
|
| 381 |
+
values = _rank_weighted_categories(
|
| 382 |
+
value_tokens, VALUE_LEXICON, label_map=VALUE_LABELS, top_n=3
|
| 383 |
+
)
|
| 384 |
+
|
| 385 |
+
avg_len = sum(lengths) / max(1, len(lengths))
|
| 386 |
+
stats = {
|
| 387 |
+
"num_utterances": float(len(utterances)),
|
| 388 |
+
"avg_utterance_len": float(avg_len),
|
| 389 |
+
"unique_token_ratio": float(len(token_counts) / max(1, len(tokens))),
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
if not emotion_tendencies and utterances:
|
| 393 |
+
emotion_tendencies = ["neutral_or_controlled"]
|
| 394 |
+
if not values and utterances:
|
| 395 |
+
values = ["implicit_values"]
|
| 396 |
+
|
| 397 |
+
examples = _select_representative_examples(utterances, top_n=5)
|
| 398 |
+
speaking_rules = _build_speaking_rules(utterances, punct_counts, avg_len, tokens)
|
| 399 |
+
cleaned_worldview_notes = [n.strip() for n in (worldview_notes or []) if n and n.strip()]
|
| 400 |
+
|
| 401 |
+
return PersonaProfile(
|
| 402 |
+
name=name,
|
| 403 |
+
style_markers=style_markers,
|
| 404 |
+
emotion_tendencies=emotion_tendencies,
|
| 405 |
+
values=values,
|
| 406 |
+
worldview_notes=cleaned_worldview_notes[:6],
|
| 407 |
+
speaking_rules=speaking_rules,
|
| 408 |
+
stats=stats,
|
| 409 |
+
examples=examples,
|
| 410 |
+
)
|
| 411 |
+
|
| 412 |
+
|
| 413 |
+
def save_persona_profile(profile: PersonaProfile, path: str) -> None:
|
| 414 |
+
with open(path, "w", encoding="utf-8") as f:
|
| 415 |
+
json.dump(profile.to_dict(), f, ensure_ascii=False, indent=2)
|
| 416 |
+
|
| 417 |
+
|
| 418 |
+
def _humanize_tag(tag: str) -> str:
|
| 419 |
+
return tag.replace("_", " ").strip()
|
| 420 |
+
|
| 421 |
+
|
| 422 |
+
def _sanitize_prompt_line(text: str) -> str:
|
| 423 |
+
return re.sub(r"\s+", " ", text.strip())
|
| 424 |
+
|
| 425 |
+
|
| 426 |
+
def render_persona_prompt(profile: PersonaProfile, template_path: str | None = None) -> str:
|
| 427 |
+
if template_path is None:
|
| 428 |
+
template_path = str(Path(__file__).parent / "templates" / "persona_prompt.txt")
|
| 429 |
+
template = Template(Path(template_path).read_text(encoding="utf-8"))
|
| 430 |
+
return template.substitute(
|
| 431 |
+
name=profile.name,
|
| 432 |
+
style_markers=", ".join(profile.style_markers),
|
| 433 |
+
emotion_tendencies=", ".join(_humanize_tag(x) for x in profile.emotion_tendencies),
|
| 434 |
+
values=", ".join(_humanize_tag(x) for x in profile.values),
|
| 435 |
+
worldview_notes="; ".join(_sanitize_prompt_line(x) for x in profile.worldview_notes),
|
| 436 |
+
speaking_rules="; ".join(profile.speaking_rules),
|
| 437 |
+
examples=" | ".join(_sanitize_prompt_line(x) for x in profile.examples),
|
| 438 |
+
)
|
| 439 |
+
|
| 440 |
+
|
| 441 |
+
def save_persona_prompt(prompt_text: str, path: str) -> None:
|
| 442 |
+
with open(path, "w", encoding="utf-8") as f:
|
| 443 |
+
f.write(prompt_text)
|
src/fic_agent/persona/templates/persona_prompt.txt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are ${name}, a character from a novel.
|
| 2 |
+
|
| 3 |
+
Distinctive style markers: ${style_markers}
|
| 4 |
+
Emotion tendencies: ${emotion_tendencies}
|
| 5 |
+
Values: ${values}
|
| 6 |
+
Worldview notes (character-relevant): ${worldview_notes}
|
| 7 |
+
Speaking rules: ${speaking_rules}
|
| 8 |
+
Example lines: ${examples}
|
| 9 |
+
|
| 10 |
+
Instructions:
|
| 11 |
+
- Stay in character.
|
| 12 |
+
- Preserve factual consistency with evidence provided.
|
| 13 |
+
- Do not introduce new facts beyond evidence.
|
| 14 |
+
- Keep the voice consistent with the style markers and speaking rules.
|
src/fic_agent/retrieval/__init__.py
ADDED
|
File without changes
|
src/fic_agent/retrieval/embeddings.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Embedding client wrapper."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import Iterable, List
|
| 6 |
+
|
| 7 |
+
import numpy as np
|
| 8 |
+
|
| 9 |
+
from ..config import RuntimeConfig
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class EmbeddingClient:
|
| 13 |
+
def __init__(self, cfg: RuntimeConfig):
|
| 14 |
+
if not cfg.embedding_api_key:
|
| 15 |
+
raise ValueError("embedding_api_key is required")
|
| 16 |
+
try:
|
| 17 |
+
from openai import OpenAI # type: ignore
|
| 18 |
+
except Exception as e:
|
| 19 |
+
raise ImportError(
|
| 20 |
+
"openai package is required for embedding API calls. Install dependencies first."
|
| 21 |
+
) from e
|
| 22 |
+
self.cfg = cfg
|
| 23 |
+
self.client = OpenAI(base_url=cfg.embedding_base_url, api_key=cfg.embedding_api_key)
|
| 24 |
+
|
| 25 |
+
def embed_texts(self, texts: Iterable[str]) -> np.ndarray:
|
| 26 |
+
items = [t.replace("\n", " ") if t else " " for t in texts]
|
| 27 |
+
if not items:
|
| 28 |
+
return np.zeros((0, 0), dtype=np.float32)
|
| 29 |
+
|
| 30 |
+
all_vectors: list[np.ndarray] = []
|
| 31 |
+
batch_size = max(1, int(self.cfg.embedding_batch_size))
|
| 32 |
+
total = len(items)
|
| 33 |
+
for i in range(0, len(items), batch_size):
|
| 34 |
+
batch = items[i : i + batch_size]
|
| 35 |
+
if self.cfg.api_progress:
|
| 36 |
+
start = i + 1
|
| 37 |
+
end = min(i + batch_size, total)
|
| 38 |
+
print(f"[embedding] requesting vectors {start}-{end}/{total}", flush=True)
|
| 39 |
+
response = self.client.embeddings.create(input=batch, model=self.cfg.embedding_model)
|
| 40 |
+
data = getattr(response, "data", None)
|
| 41 |
+
if not data:
|
| 42 |
+
raise RuntimeError(
|
| 43 |
+
"Embedding API returned empty data. Check API key, model, quota, and base_url."
|
| 44 |
+
)
|
| 45 |
+
if len(data) != len(batch):
|
| 46 |
+
raise RuntimeError(
|
| 47 |
+
f"Embedding API returned {len(data)} items for batch size {len(batch)}."
|
| 48 |
+
)
|
| 49 |
+
vectors = np.array([v.embedding for v in data], dtype=np.float32)
|
| 50 |
+
if vectors.ndim != 2 or vectors.shape[1] == 0:
|
| 51 |
+
raise RuntimeError(
|
| 52 |
+
"Embedding API returned empty vectors. Verify model name and account access."
|
| 53 |
+
)
|
| 54 |
+
all_vectors.append(vectors)
|
| 55 |
+
|
| 56 |
+
return np.vstack(all_vectors)
|
src/fic_agent/retrieval/retriever.py
ADDED
|
@@ -0,0 +1,572 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tri-retrieve interfaces for facts, persona, and worldview."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from dataclasses import dataclass
|
| 6 |
+
from concurrent.futures import ThreadPoolExecutor
|
| 7 |
+
import json
|
| 8 |
+
import math
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
import re
|
| 11 |
+
from typing import Dict, List, Optional, Sequence, Tuple
|
| 12 |
+
|
| 13 |
+
import numpy as np
|
| 14 |
+
|
| 15 |
+
from ..config import RuntimeConfig
|
| 16 |
+
from .embeddings import EmbeddingClient
|
| 17 |
+
from .vector_store import (
|
| 18 |
+
build_faiss_index,
|
| 19 |
+
load_index,
|
| 20 |
+
load_metadata,
|
| 21 |
+
save_index,
|
| 22 |
+
save_metadata,
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
ENTITY_PATTERN = re.compile(r"\b([A-Z][a-z]+(?:\s+[A-Z][a-z]+){0,2})\b")
|
| 27 |
+
WORD_PATTERN = re.compile(r"[A-Za-z']+")
|
| 28 |
+
|
| 29 |
+
RULE_HINTS = {
|
| 30 |
+
"rule",
|
| 31 |
+
"law",
|
| 32 |
+
"forbidden",
|
| 33 |
+
"allowed",
|
| 34 |
+
"must",
|
| 35 |
+
"cannot",
|
| 36 |
+
"can't",
|
| 37 |
+
"should",
|
| 38 |
+
"never",
|
| 39 |
+
}
|
| 40 |
+
LOC_ORG_HINTS = {
|
| 41 |
+
"city",
|
| 42 |
+
"town",
|
| 43 |
+
"village",
|
| 44 |
+
"kingdom",
|
| 45 |
+
"castle",
|
| 46 |
+
"street",
|
| 47 |
+
"house",
|
| 48 |
+
"organization",
|
| 49 |
+
"order",
|
| 50 |
+
"guild",
|
| 51 |
+
"council",
|
| 52 |
+
"family",
|
| 53 |
+
"group",
|
| 54 |
+
}
|
| 55 |
+
STOPWORDS = {
|
| 56 |
+
"a",
|
| 57 |
+
"an",
|
| 58 |
+
"and",
|
| 59 |
+
"are",
|
| 60 |
+
"as",
|
| 61 |
+
"at",
|
| 62 |
+
"be",
|
| 63 |
+
"by",
|
| 64 |
+
"for",
|
| 65 |
+
"from",
|
| 66 |
+
"in",
|
| 67 |
+
"is",
|
| 68 |
+
"it",
|
| 69 |
+
"of",
|
| 70 |
+
"on",
|
| 71 |
+
"or",
|
| 72 |
+
"that",
|
| 73 |
+
"the",
|
| 74 |
+
"to",
|
| 75 |
+
"was",
|
| 76 |
+
"were",
|
| 77 |
+
"with",
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
@dataclass
|
| 82 |
+
class IndexBundle:
|
| 83 |
+
index_path: str
|
| 84 |
+
meta_path: str
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
def _default_index_paths(cfg: RuntimeConfig, name: str) -> IndexBundle:
|
| 88 |
+
base = Path(cfg.data_index_dir)
|
| 89 |
+
return IndexBundle(
|
| 90 |
+
index_path=str(base / f"{name}.faiss"),
|
| 91 |
+
meta_path=str(base / f"{name}.jsonl"),
|
| 92 |
+
)
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
def _normalize_query_vector(v: np.ndarray) -> np.ndarray:
|
| 96 |
+
q = v.astype(np.float32)
|
| 97 |
+
if q.ndim == 1:
|
| 98 |
+
q = q.reshape(1, -1)
|
| 99 |
+
norms = np.linalg.norm(q, axis=1, keepdims=True)
|
| 100 |
+
norms = np.where(norms <= 0.0, 1.0, norms)
|
| 101 |
+
q = q / norms
|
| 102 |
+
return q
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
def _safe_text(value: object) -> str:
|
| 106 |
+
return str(value or "").strip()
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
def _tokenize(text: str) -> List[str]:
|
| 110 |
+
out: List[str] = []
|
| 111 |
+
for w in WORD_PATTERN.findall(text or ""):
|
| 112 |
+
t = w.lower().strip("'")
|
| 113 |
+
if not t:
|
| 114 |
+
continue
|
| 115 |
+
out.append(t)
|
| 116 |
+
return out
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
def _keyword_set(text: str) -> set[str]:
|
| 120 |
+
return {t for t in _tokenize(text) if len(t) >= 3 and t not in STOPWORDS}
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
def _extract_entities(text: str) -> set[str]:
|
| 124 |
+
entities = {m.group(1).strip().lower() for m in ENTITY_PATTERN.finditer(text or "")}
|
| 125 |
+
# Fall back to keyword-based "entities" for lowercase user questions.
|
| 126 |
+
if not entities:
|
| 127 |
+
entities = {t for t in _keyword_set(text) if len(t) >= 4}
|
| 128 |
+
return entities
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
def _overlap_ratio(a: set[str], b: set[str]) -> float:
|
| 132 |
+
if not a:
|
| 133 |
+
return 0.0
|
| 134 |
+
return len(a & b) / max(1, len(a))
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
def _estimate_tokens(text: str) -> int:
|
| 138 |
+
return max(1, len(_tokenize(text)))
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
def _clamp(v: int, low: int, high: int) -> int:
|
| 142 |
+
return max(low, min(v, high))
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
def _read_json(path: Path) -> Dict:
|
| 146 |
+
with open(path, "r", encoding="utf-8") as f:
|
| 147 |
+
return json.load(f)
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
def _load_persona_markers(cfg: RuntimeConfig, character: Optional[str]) -> List[str]:
|
| 151 |
+
if not character:
|
| 152 |
+
return []
|
| 153 |
+
safe = character.replace("/", "_")
|
| 154 |
+
profile_path = Path(cfg.data_processed_dir) / f"persona_{safe}.json"
|
| 155 |
+
if not profile_path.exists():
|
| 156 |
+
return []
|
| 157 |
+
try:
|
| 158 |
+
obj = _read_json(profile_path)
|
| 159 |
+
except Exception:
|
| 160 |
+
return []
|
| 161 |
+
markers = obj.get("style_markers")
|
| 162 |
+
if not isinstance(markers, list):
|
| 163 |
+
return []
|
| 164 |
+
return [str(x).strip().lower() for x in markers if str(x).strip()]
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
def _style_marker_overlap(text: str, markers: Sequence[str]) -> float:
|
| 168 |
+
if not markers:
|
| 169 |
+
return 0.0
|
| 170 |
+
text_l = (text or "").lower()
|
| 171 |
+
tok = set(_tokenize(text_l))
|
| 172 |
+
hits = 0
|
| 173 |
+
for m in markers:
|
| 174 |
+
if " " in m:
|
| 175 |
+
if m in text_l:
|
| 176 |
+
hits += 1
|
| 177 |
+
elif m in tok:
|
| 178 |
+
hits += 1
|
| 179 |
+
return hits / max(1, len(markers))
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
def _entity_overlap(query: str, row: Dict) -> float:
|
| 183 |
+
q_ents = _extract_entities(query)
|
| 184 |
+
row_text = _safe_text(row.get("text"))
|
| 185 |
+
row_entity = _safe_text(row.get("entity"))
|
| 186 |
+
r_ents = _extract_entities(f"{row_entity} {row_text}")
|
| 187 |
+
return _overlap_ratio(q_ents, r_ents)
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
def _recency_boost(row: Dict, max_chapter: int) -> float:
|
| 191 |
+
if max_chapter <= 0:
|
| 192 |
+
return 0.0
|
| 193 |
+
chapter_id = row.get("chapter_id")
|
| 194 |
+
if not isinstance(chapter_id, int):
|
| 195 |
+
return 0.0
|
| 196 |
+
return chapter_id / max_chapter
|
| 197 |
+
|
| 198 |
+
|
| 199 |
+
def _graph_ppr(_row: Dict) -> float:
|
| 200 |
+
# Placeholder when a graph index is not available.
|
| 201 |
+
return 0.0
|
| 202 |
+
|
| 203 |
+
|
| 204 |
+
def _speaker_match(row: Dict, character: Optional[str]) -> float:
|
| 205 |
+
if not character:
|
| 206 |
+
return 0.0
|
| 207 |
+
return 1.0 if _safe_text(row.get("speaker")).lower() == character.lower() else 0.0
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
def _rule_match(query: str, row: Dict) -> float:
|
| 211 |
+
q_words = _keyword_set(query)
|
| 212 |
+
row_text = _safe_text(row.get("text")).lower()
|
| 213 |
+
row_words = _keyword_set(row_text)
|
| 214 |
+
rule_overlap = _overlap_ratio(q_words & RULE_HINTS, row_words | set(_tokenize(_safe_text(row.get("type")))))
|
| 215 |
+
if _safe_text(row.get("type")).lower() == "rule":
|
| 216 |
+
return max(rule_overlap, 0.25 if q_words & RULE_HINTS else 0.0)
|
| 217 |
+
return rule_overlap
|
| 218 |
+
|
| 219 |
+
|
| 220 |
+
def _location_org_overlap(query: str, row: Dict) -> float:
|
| 221 |
+
q_keys = (_keyword_set(query) & LOC_ORG_HINTS) | _extract_entities(query)
|
| 222 |
+
row_keys = (_keyword_set(_safe_text(row.get("text"))) & LOC_ORG_HINTS) | _extract_entities(
|
| 223 |
+
f"{_safe_text(row.get('entity'))} {_safe_text(row.get('text'))}"
|
| 224 |
+
)
|
| 225 |
+
return _overlap_ratio(q_keys, row_keys)
|
| 226 |
+
|
| 227 |
+
|
| 228 |
+
def _compute_fact_score(base_score: float, row: Dict, query: str, cfg: RuntimeConfig, max_chapter: int) -> Tuple[float, Dict[str, float]]:
|
| 229 |
+
entity = _entity_overlap(query, row)
|
| 230 |
+
recency = _recency_boost(row, max_chapter)
|
| 231 |
+
graph = _graph_ppr(row)
|
| 232 |
+
score = (
|
| 233 |
+
cfg.fact_w_cos * base_score
|
| 234 |
+
+ cfg.fact_w_entity * entity
|
| 235 |
+
+ cfg.fact_w_recency * recency
|
| 236 |
+
+ cfg.fact_w_graph * graph
|
| 237 |
+
)
|
| 238 |
+
return score, {
|
| 239 |
+
"cos": base_score,
|
| 240 |
+
"entity_overlap": entity,
|
| 241 |
+
"recency_boost": recency,
|
| 242 |
+
"graph_ppr": graph,
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
|
| 246 |
+
def _compute_persona_score(
|
| 247 |
+
base_score: float,
|
| 248 |
+
row: Dict,
|
| 249 |
+
query: str,
|
| 250 |
+
character: Optional[str],
|
| 251 |
+
markers: Sequence[str],
|
| 252 |
+
cfg: RuntimeConfig,
|
| 253 |
+
) -> Tuple[float, Dict[str, float]]:
|
| 254 |
+
spk = _speaker_match(row, character)
|
| 255 |
+
style = _style_marker_overlap(_safe_text(row.get("text")), markers)
|
| 256 |
+
score = cfg.persona_w_cos * base_score + cfg.persona_w_speaker * spk + cfg.persona_w_style * style
|
| 257 |
+
return score, {
|
| 258 |
+
"cos": base_score,
|
| 259 |
+
"speaker_match": spk,
|
| 260 |
+
"style_marker_overlap": style,
|
| 261 |
+
"query_overlap": _overlap_ratio(_keyword_set(query), _keyword_set(_safe_text(row.get("text")))),
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
|
| 265 |
+
def _compute_worldview_score(base_score: float, row: Dict, query: str, cfg: RuntimeConfig) -> Tuple[float, Dict[str, float]]:
|
| 266 |
+
rule = _rule_match(query, row)
|
| 267 |
+
loc_org = _location_org_overlap(query, row)
|
| 268 |
+
score = cfg.worldview_w_cos * base_score + cfg.worldview_w_rule * rule + cfg.worldview_w_locorg * loc_org
|
| 269 |
+
return score, {
|
| 270 |
+
"cos": base_score,
|
| 271 |
+
"rule_match": rule,
|
| 272 |
+
"location_org_overlap": loc_org,
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
|
| 276 |
+
def _dynamic_k(candidates: List[Dict], budget_tokens: int, cfg: RuntimeConfig) -> int:
|
| 277 |
+
if not candidates:
|
| 278 |
+
return 0
|
| 279 |
+
avg_len = sum(_estimate_tokens(_safe_text(c.get("text"))) for c in candidates) / max(1, len(candidates))
|
| 280 |
+
k_budget = max(1, math.floor(budget_tokens / max(1.0, avg_len)))
|
| 281 |
+
scores = [float(c.get("score", 0.0)) for c in candidates]
|
| 282 |
+
s_max = max(scores)
|
| 283 |
+
k_score_delta = sum(1 for s in scores if s >= s_max - cfg.tri_score_delta)
|
| 284 |
+
k_score_tau = sum(1 for s in scores if s >= cfg.tri_score_tau)
|
| 285 |
+
k_score = k_score_delta if k_score_delta > 0 else k_score_tau
|
| 286 |
+
if k_score <= 0:
|
| 287 |
+
k_score = cfg.tri_k_min
|
| 288 |
+
k = _clamp(min(k_budget, k_score, cfg.tri_k_max), cfg.tri_k_min, cfg.tri_k_max)
|
| 289 |
+
return min(k, len(candidates))
|
| 290 |
+
|
| 291 |
+
|
| 292 |
+
def _cosine(a: np.ndarray, b: np.ndarray) -> float:
|
| 293 |
+
return float(np.dot(a, b) / max(1e-8, np.linalg.norm(a) * np.linalg.norm(b)))
|
| 294 |
+
|
| 295 |
+
|
| 296 |
+
def _mmr_select(candidates: List[Dict], k: int, lamb: float) -> List[Dict]:
|
| 297 |
+
if k <= 0:
|
| 298 |
+
return []
|
| 299 |
+
if len(candidates) <= k:
|
| 300 |
+
return candidates
|
| 301 |
+
|
| 302 |
+
selected: List[Dict] = []
|
| 303 |
+
remaining = candidates[:]
|
| 304 |
+
remaining.sort(key=lambda x: x.get("score", 0.0), reverse=True)
|
| 305 |
+
selected.append(remaining.pop(0))
|
| 306 |
+
|
| 307 |
+
while remaining and len(selected) < k:
|
| 308 |
+
best_idx = 0
|
| 309 |
+
best_mmr = -1e9
|
| 310 |
+
for idx, cand in enumerate(remaining):
|
| 311 |
+
rel = float(cand.get("score", 0.0))
|
| 312 |
+
c_vec = cand.get("_vec")
|
| 313 |
+
if c_vec is None:
|
| 314 |
+
mmr = rel
|
| 315 |
+
else:
|
| 316 |
+
div = 0.0
|
| 317 |
+
for s in selected:
|
| 318 |
+
s_vec = s.get("_vec")
|
| 319 |
+
if s_vec is None:
|
| 320 |
+
continue
|
| 321 |
+
div = max(div, _cosine(c_vec, s_vec))
|
| 322 |
+
mmr = lamb * rel - (1.0 - lamb) * div
|
| 323 |
+
if mmr > best_mmr:
|
| 324 |
+
best_mmr = mmr
|
| 325 |
+
best_idx = idx
|
| 326 |
+
selected.append(remaining.pop(best_idx))
|
| 327 |
+
return selected
|
| 328 |
+
|
| 329 |
+
|
| 330 |
+
def _search_candidates(
|
| 331 |
+
index,
|
| 332 |
+
metadata: List[Dict],
|
| 333 |
+
query_vec: np.ndarray,
|
| 334 |
+
top_n: int,
|
| 335 |
+
) -> List[Dict]:
|
| 336 |
+
q = _normalize_query_vector(query_vec)
|
| 337 |
+
if index.ntotal <= 0:
|
| 338 |
+
return []
|
| 339 |
+
n = min(top_n, index.ntotal)
|
| 340 |
+
scores, idxs = index.search(q, n)
|
| 341 |
+
out: List[Dict] = []
|
| 342 |
+
for i, score in zip(idxs[0], scores[0]):
|
| 343 |
+
if i < 0 or i >= len(metadata):
|
| 344 |
+
continue
|
| 345 |
+
row = dict(metadata[i])
|
| 346 |
+
row["_faiss_id"] = int(i)
|
| 347 |
+
row["base_score"] = float(score)
|
| 348 |
+
try:
|
| 349 |
+
vec = index.reconstruct(int(i)).astype(np.float32)
|
| 350 |
+
norm = np.linalg.norm(vec)
|
| 351 |
+
row["_vec"] = vec / norm if norm > 0 else vec
|
| 352 |
+
except Exception:
|
| 353 |
+
row["_vec"] = None
|
| 354 |
+
out.append(row)
|
| 355 |
+
return out
|
| 356 |
+
|
| 357 |
+
|
| 358 |
+
def _score_lane(
|
| 359 |
+
lane: str,
|
| 360 |
+
candidates: List[Dict],
|
| 361 |
+
query: str,
|
| 362 |
+
cfg: RuntimeConfig,
|
| 363 |
+
character: Optional[str] = None,
|
| 364 |
+
persona_markers: Optional[List[str]] = None,
|
| 365 |
+
) -> List[Dict]:
|
| 366 |
+
max_chapter = 0
|
| 367 |
+
if lane == "facts":
|
| 368 |
+
chapter_ids = [int(r["chapter_id"]) for r in candidates if isinstance(r.get("chapter_id"), int)]
|
| 369 |
+
max_chapter = max(chapter_ids) if chapter_ids else 0
|
| 370 |
+
|
| 371 |
+
scored: List[Dict] = []
|
| 372 |
+
markers = persona_markers or []
|
| 373 |
+
for row in candidates:
|
| 374 |
+
base = float(row.get("base_score", 0.0))
|
| 375 |
+
if lane == "facts":
|
| 376 |
+
score, features = _compute_fact_score(base, row, query, cfg, max_chapter=max_chapter)
|
| 377 |
+
elif lane == "persona":
|
| 378 |
+
score, features = _compute_persona_score(base, row, query, character, markers, cfg)
|
| 379 |
+
else:
|
| 380 |
+
score, features = _compute_worldview_score(base, row, query, cfg)
|
| 381 |
+
row["score"] = float(score)
|
| 382 |
+
row["features"] = features
|
| 383 |
+
scored.append(row)
|
| 384 |
+
scored.sort(key=lambda x: x["score"], reverse=True)
|
| 385 |
+
return scored
|
| 386 |
+
|
| 387 |
+
|
| 388 |
+
def _finalize_rows(rows: List[Dict], lane: str) -> List[Dict]:
|
| 389 |
+
final: List[Dict] = []
|
| 390 |
+
for i, r in enumerate(rows, start=1):
|
| 391 |
+
row = {k: v for k, v in r.items() if not k.startswith("_")}
|
| 392 |
+
row["rank"] = i
|
| 393 |
+
row["lane"] = lane
|
| 394 |
+
final.append(row)
|
| 395 |
+
return final
|
| 396 |
+
|
| 397 |
+
|
| 398 |
+
def _retrieve_lane(
|
| 399 |
+
lane: str,
|
| 400 |
+
query: str,
|
| 401 |
+
query_vec: np.ndarray,
|
| 402 |
+
cfg: RuntimeConfig,
|
| 403 |
+
budget_tokens: int,
|
| 404 |
+
character: Optional[str] = None,
|
| 405 |
+
persona_markers: Optional[List[str]] = None,
|
| 406 |
+
top_k_override: Optional[int] = None,
|
| 407 |
+
) -> List[Dict]:
|
| 408 |
+
index, meta = load_bundle(cfg, lane)
|
| 409 |
+
candidates = _search_candidates(index, meta, query_vec, top_n=max(cfg.tri_candidate_pool, cfg.tri_k_max))
|
| 410 |
+
scored = _score_lane(
|
| 411 |
+
lane=lane,
|
| 412 |
+
candidates=candidates,
|
| 413 |
+
query=query,
|
| 414 |
+
cfg=cfg,
|
| 415 |
+
character=character,
|
| 416 |
+
persona_markers=persona_markers,
|
| 417 |
+
)
|
| 418 |
+
if top_k_override is None:
|
| 419 |
+
k = _dynamic_k(scored, budget_tokens=budget_tokens, cfg=cfg)
|
| 420 |
+
else:
|
| 421 |
+
k = min(max(1, top_k_override), len(scored))
|
| 422 |
+
selected = _mmr_select(scored, k=k, lamb=cfg.tri_mmr_lambda)
|
| 423 |
+
return _finalize_rows(selected, lane=lane)
|
| 424 |
+
|
| 425 |
+
|
| 426 |
+
def decompose_query(query: str, character: Optional[str] = None) -> Dict[str, str]:
|
| 427 |
+
q = _safe_text(query)
|
| 428 |
+
q_l = q.lower()
|
| 429 |
+
persona_hint = "style" in q_l or "tone" in q_l or "feel" in q_l or "would" in q_l
|
| 430 |
+
worldview_hint = bool(_keyword_set(q_l) & (RULE_HINTS | LOC_ORG_HINTS)) or "world" in q_l
|
| 431 |
+
|
| 432 |
+
fact_query = q
|
| 433 |
+
persona_query = q if persona_hint else f"{q}. Reply as {character}." if character else q
|
| 434 |
+
worldview_query = q if worldview_hint else f"{q}. Keep consistency with setting and rules."
|
| 435 |
+
|
| 436 |
+
return {
|
| 437 |
+
"fact_query": fact_query,
|
| 438 |
+
"persona_query": persona_query,
|
| 439 |
+
"worldview_query": worldview_query,
|
| 440 |
+
"fact_need": q,
|
| 441 |
+
"role_attitude": f"character={character or 'unknown'}",
|
| 442 |
+
"world_constraints": "strict if applicable",
|
| 443 |
+
}
|
| 444 |
+
|
| 445 |
+
|
| 446 |
+
def build_index_for_texts(
|
| 447 |
+
texts: List[str],
|
| 448 |
+
metadata_rows: List[Dict],
|
| 449 |
+
cfg: RuntimeConfig,
|
| 450 |
+
name: str,
|
| 451 |
+
) -> IndexBundle:
|
| 452 |
+
emb = EmbeddingClient(cfg).embed_texts(texts)
|
| 453 |
+
index = build_faiss_index(emb, normalize=True)
|
| 454 |
+
paths = _default_index_paths(cfg, name)
|
| 455 |
+
save_index(index, paths.index_path)
|
| 456 |
+
save_metadata(metadata_rows, paths.meta_path)
|
| 457 |
+
return paths
|
| 458 |
+
|
| 459 |
+
|
| 460 |
+
def load_bundle(cfg: RuntimeConfig, name: str):
|
| 461 |
+
paths = _default_index_paths(cfg, name)
|
| 462 |
+
index = load_index(paths.index_path)
|
| 463 |
+
meta = load_metadata(paths.meta_path)
|
| 464 |
+
return index, meta
|
| 465 |
+
|
| 466 |
+
|
| 467 |
+
def retrieve_facts(query: str, cfg: RuntimeConfig, top_k: int = 8) -> List[Dict]:
|
| 468 |
+
q_vec = EmbeddingClient(cfg).embed_texts([query])
|
| 469 |
+
return _retrieve_lane(
|
| 470 |
+
lane="facts",
|
| 471 |
+
query=query,
|
| 472 |
+
query_vec=q_vec,
|
| 473 |
+
cfg=cfg,
|
| 474 |
+
budget_tokens=cfg.tri_budget_fact,
|
| 475 |
+
top_k_override=top_k,
|
| 476 |
+
)
|
| 477 |
+
|
| 478 |
+
|
| 479 |
+
def retrieve_worldview(query: str, cfg: RuntimeConfig, top_k: int = 5) -> List[Dict]:
|
| 480 |
+
q_vec = EmbeddingClient(cfg).embed_texts([query])
|
| 481 |
+
return _retrieve_lane(
|
| 482 |
+
lane="worldview",
|
| 483 |
+
query=query,
|
| 484 |
+
query_vec=q_vec,
|
| 485 |
+
cfg=cfg,
|
| 486 |
+
budget_tokens=cfg.tri_budget_worldview,
|
| 487 |
+
top_k_override=top_k,
|
| 488 |
+
)
|
| 489 |
+
|
| 490 |
+
|
| 491 |
+
def retrieve_persona(
|
| 492 |
+
query: str,
|
| 493 |
+
cfg: RuntimeConfig,
|
| 494 |
+
character: Optional[str] = None,
|
| 495 |
+
top_k: int = 5,
|
| 496 |
+
) -> List[Dict]:
|
| 497 |
+
q_vec = EmbeddingClient(cfg).embed_texts([query])
|
| 498 |
+
markers = _load_persona_markers(cfg, character)
|
| 499 |
+
return _retrieve_lane(
|
| 500 |
+
lane="persona",
|
| 501 |
+
query=query,
|
| 502 |
+
query_vec=q_vec,
|
| 503 |
+
cfg=cfg,
|
| 504 |
+
budget_tokens=cfg.tri_budget_persona,
|
| 505 |
+
character=character,
|
| 506 |
+
persona_markers=markers,
|
| 507 |
+
top_k_override=top_k,
|
| 508 |
+
)
|
| 509 |
+
|
| 510 |
+
|
| 511 |
+
def tri_retrieve(query: str, cfg: RuntimeConfig, character: Optional[str] = None) -> Dict[str, object]:
|
| 512 |
+
plan = decompose_query(query, character=character)
|
| 513 |
+
embed = EmbeddingClient(cfg)
|
| 514 |
+
q_vecs = embed.embed_texts(
|
| 515 |
+
[plan["fact_query"], plan["persona_query"], plan["worldview_query"]]
|
| 516 |
+
)
|
| 517 |
+
|
| 518 |
+
budget_fact = cfg.tri_budget_fact
|
| 519 |
+
budget_persona = cfg.tri_budget_persona
|
| 520 |
+
budget_worldview = cfg.tri_budget_worldview
|
| 521 |
+
|
| 522 |
+
persona_markers = _load_persona_markers(cfg, character)
|
| 523 |
+
facts = _retrieve_lane(
|
| 524 |
+
lane="facts",
|
| 525 |
+
query=plan["fact_query"],
|
| 526 |
+
query_vec=q_vecs[0:1],
|
| 527 |
+
cfg=cfg,
|
| 528 |
+
budget_tokens=budget_fact,
|
| 529 |
+
)
|
| 530 |
+
max_fact_score = max((float(x.get("score", 0.0)) for x in facts), default=0.0)
|
| 531 |
+
if max_fact_score < cfg.tri_tau_low:
|
| 532 |
+
shift = min(cfg.tri_budget_shift, budget_fact // 2)
|
| 533 |
+
budget_fact -= shift
|
| 534 |
+
budget_persona += shift // 2
|
| 535 |
+
budget_worldview += shift - shift // 2
|
| 536 |
+
|
| 537 |
+
with ThreadPoolExecutor(max_workers=2) as ex:
|
| 538 |
+
fut_persona = ex.submit(
|
| 539 |
+
_retrieve_lane,
|
| 540 |
+
"persona",
|
| 541 |
+
plan["persona_query"],
|
| 542 |
+
q_vecs[1:2],
|
| 543 |
+
cfg,
|
| 544 |
+
budget_persona,
|
| 545 |
+
character,
|
| 546 |
+
persona_markers,
|
| 547 |
+
)
|
| 548 |
+
fut_worldview = ex.submit(
|
| 549 |
+
_retrieve_lane,
|
| 550 |
+
"worldview",
|
| 551 |
+
plan["worldview_query"],
|
| 552 |
+
q_vecs[2:3],
|
| 553 |
+
cfg,
|
| 554 |
+
budget_worldview,
|
| 555 |
+
None,
|
| 556 |
+
None,
|
| 557 |
+
)
|
| 558 |
+
persona = fut_persona.result()
|
| 559 |
+
worldview = fut_worldview.result()
|
| 560 |
+
|
| 561 |
+
return {
|
| 562 |
+
"query_plan": plan,
|
| 563 |
+
"budgets": {
|
| 564 |
+
"fact": budget_fact,
|
| 565 |
+
"persona": budget_persona,
|
| 566 |
+
"worldview": budget_worldview,
|
| 567 |
+
"fact_max_score": max_fact_score,
|
| 568 |
+
},
|
| 569 |
+
"facts": facts,
|
| 570 |
+
"persona": persona,
|
| 571 |
+
"worldview": worldview,
|
| 572 |
+
}
|
src/fic_agent/retrieval/vector_store.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Faiss vector store utilities."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import json
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
from typing import Dict, Iterable, List, Tuple
|
| 8 |
+
|
| 9 |
+
import numpy as np
|
| 10 |
+
|
| 11 |
+
try:
|
| 12 |
+
import faiss # type: ignore
|
| 13 |
+
except Exception: # pragma: no cover - fallback for environments without faiss
|
| 14 |
+
faiss = None
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def _require_faiss():
|
| 18 |
+
if faiss is None:
|
| 19 |
+
raise ImportError(
|
| 20 |
+
"faiss is required for vector index operations. Install `faiss-cpu` in the active environment."
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def _normalize(vectors: np.ndarray) -> np.ndarray:
|
| 25 |
+
if vectors.size == 0:
|
| 26 |
+
return vectors
|
| 27 |
+
if faiss is not None:
|
| 28 |
+
faiss.normalize_L2(vectors)
|
| 29 |
+
return vectors
|
| 30 |
+
norms = np.linalg.norm(vectors, axis=1, keepdims=True)
|
| 31 |
+
norms = np.where(norms <= 0.0, 1.0, norms)
|
| 32 |
+
vectors /= norms
|
| 33 |
+
return vectors
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def build_faiss_index(embeddings: np.ndarray, normalize: bool = True):
|
| 37 |
+
_require_faiss()
|
| 38 |
+
if embeddings.size == 0:
|
| 39 |
+
raise ValueError("embeddings are empty")
|
| 40 |
+
vecs = embeddings.copy()
|
| 41 |
+
if normalize:
|
| 42 |
+
vecs = _normalize(vecs)
|
| 43 |
+
index = faiss.IndexFlatIP(vecs.shape[1])
|
| 44 |
+
else:
|
| 45 |
+
index = faiss.IndexFlatL2(vecs.shape[1])
|
| 46 |
+
index.add(vecs)
|
| 47 |
+
return index
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
def save_index(index, path: str) -> None:
|
| 51 |
+
_require_faiss()
|
| 52 |
+
Path(path).parent.mkdir(parents=True, exist_ok=True)
|
| 53 |
+
faiss.write_index(index, path)
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def load_index(path: str):
|
| 57 |
+
_require_faiss()
|
| 58 |
+
return faiss.read_index(path)
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def save_metadata(rows: Iterable[Dict], path: str) -> None:
|
| 62 |
+
Path(path).parent.mkdir(parents=True, exist_ok=True)
|
| 63 |
+
with open(path, "w", encoding="utf-8") as f:
|
| 64 |
+
for r in rows:
|
| 65 |
+
f.write(json.dumps(r, ensure_ascii=False) + "\n")
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def load_metadata(path: str) -> List[Dict]:
|
| 69 |
+
rows = []
|
| 70 |
+
with open(path, "r", encoding="utf-8") as f:
|
| 71 |
+
for line in f:
|
| 72 |
+
line = line.strip()
|
| 73 |
+
if not line:
|
| 74 |
+
continue
|
| 75 |
+
rows.append(json.loads(line))
|
| 76 |
+
return rows
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
def search_index(
|
| 80 |
+
index,
|
| 81 |
+
metadata: List[Dict],
|
| 82 |
+
query_vec: np.ndarray,
|
| 83 |
+
top_k: int = 5,
|
| 84 |
+
normalize: bool = True,
|
| 85 |
+
) -> List[Tuple[Dict, float]]:
|
| 86 |
+
if query_vec.ndim == 1:
|
| 87 |
+
query_vec = query_vec.reshape(1, -1)
|
| 88 |
+
q = query_vec.astype(np.float32)
|
| 89 |
+
if normalize:
|
| 90 |
+
_normalize(q)
|
| 91 |
+
scores, idxs = index.search(q, top_k)
|
| 92 |
+
results: List[Tuple[Dict, float]] = []
|
| 93 |
+
for i, score in zip(idxs[0], scores[0]):
|
| 94 |
+
if i < 0 or i >= len(metadata):
|
| 95 |
+
continue
|
| 96 |
+
results.append((metadata[i], float(score)))
|
| 97 |
+
return results
|
src/fic_agent/utils/__init__.py
ADDED
|
File without changes
|
src/fic_agent/utils/io.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""I/O helpers."""
|
| 2 |
+
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def read_text(path: str) -> str:
|
| 7 |
+
return Path(path).read_text(encoding="utf-8")
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def write_text(path: str, text: str) -> None:
|
| 11 |
+
Path(path).parent.mkdir(parents=True, exist_ok=True)
|
| 12 |
+
Path(path).write_text(text, encoding="utf-8")
|
src/fic_agent/worldview/__init__.py
ADDED
|
File without changes
|