Sync platform with GitHub 49850ec
Browse files- LLM base URL default is now a placeholder; set LLM_BASE_URL in env
- Remove hardcoded llm_base_url from demo seed so env value takes effect
- README updates (figure is referenced from GitHub raw URL)
- .env.example +1 -1
- README.md +7 -6
- README_zh.md +7 -6
- qa_annotate/config.py +1 -1
- qa_annotate/static/js/system-config-management.js +1 -1
- qa_annotate/static/locales/en-US.json +1 -1
- qa_annotate/static/locales/zh-CN.json +1 -1
- seed/demo.sql +0 -1
.env.example
CHANGED
|
@@ -14,5 +14,5 @@ TOKEN_EXPIRE_DAYS=7
|
|
| 14 |
|
| 15 |
# LLM 配置(可选;未设置时使用 Demo 默认值)
|
| 16 |
# LLM_API_KEY=your-token-here
|
| 17 |
-
# LLM_BASE_URL=
|
| 18 |
# LLM_MODEL_NAME=gpt-5.1
|
|
|
|
| 14 |
|
| 15 |
# LLM 配置(可选;未设置时使用 Demo 默认值)
|
| 16 |
# LLM_API_KEY=your-token-here
|
| 17 |
+
# LLM_BASE_URL=https://api.example.com/v1
|
| 18 |
# LLM_MODEL_NAME=gpt-5.1
|
README.md
CHANGED
|
@@ -9,7 +9,7 @@ pinned: false
|
|
| 9 |
|
| 10 |
# QA Annotation System
|
| 11 |
|
| 12 |
-
The **Expert Validation Platform** in [QALoop](https://github.com/JackKuo666/QALoop)
|
| 13 |
|
| 14 |
## Demo Usage
|
| 15 |
|
|
@@ -91,7 +91,7 @@ Currently in `production` mode: new users can self-register, but must be **manua
|
|
| 91 |
|----------|---------|-------------|
|
| 92 |
| `DB_DIR` | `/data` | SQLite data directory (Dockerfile defaults to `/data`) |
|
| 93 |
| `ENVIRONMENT` | `production` | New registrations require admin enablement |
|
| 94 |
-
| `LLM_BASE_URL` | `
|
| 95 |
| `LLM_MODEL_NAME` | `gpt-5.1` | LLM model name |
|
| 96 |
|
| 97 |
6. **LLM Analysis (optional)**: Set in Space **Settings → Repository secrets**:
|
|
@@ -103,11 +103,12 @@ Currently in `production` mode: new users can self-register, but must be **manua
|
|
| 103 |
Demo pre-fills Base URL and model name for OpenAI-compatible calls:
|
| 104 |
|
| 105 |
```python
|
|
|
|
| 106 |
from openai import OpenAI
|
| 107 |
|
| 108 |
client = OpenAI(
|
| 109 |
-
base_url="
|
| 110 |
-
api_key="
|
| 111 |
)
|
| 112 |
# model: gpt-5.1
|
| 113 |
```
|
|
@@ -122,7 +123,7 @@ client = OpenAI(
|
|
| 122 |
- **Flexible annotation configs** — Rating, category, text, single/multi-select, binary; optional reason and confidence fields
|
| 123 |
- **Collaboration and permissions** — Superuser admin dashboard; regular users claim tasks and annotate; JWT auth
|
| 124 |
- **Analysis and export** — Annotation progress and statistics; configurable simplified export
|
| 125 |
-
- **Optional LLM** — OpenAI-compatible Chat API, default `
|
| 126 |
- **Seed questions** — Predefined question templates organized by type/subtype
|
| 127 |
- **UI language** — Chinese and English (i18n)
|
| 128 |
|
|
@@ -365,7 +366,7 @@ ruff format .
|
|
| 365 |
|
| 366 |
## Research and Citation
|
| 367 |
|
| 368 |
-
This platform is the **Expert Validation Platform** component of QALoop. If you use it in a publication, please cite the QALoop
|
| 369 |
|
| 370 |
## Roadmap
|
| 371 |
|
|
|
|
| 9 |
|
| 10 |
# QA Annotation System
|
| 11 |
|
| 12 |
+
The **Expert Validation Platform** in [QALoop](https://github.com/JackKuo666/QALoop), the code release for the DASFAA 2027 Industry Track submission on expert-involved domain QA data production. This web application supports **collaborative QA annotation and quality management**: multi-user task workflows, configurable annotation schemas, statistics and export, plus optional **LLM-assisted review of annotation notes**. It receives candidate QA pairs from upstream synthesis pipelines and converts expert judgments into structured feedback for pipeline iteration.
|
| 13 |
|
| 14 |
## Demo Usage
|
| 15 |
|
|
|
|
| 91 |
|----------|---------|-------------|
|
| 92 |
| `DB_DIR` | `/data` | SQLite data directory (Dockerfile defaults to `/data`) |
|
| 93 |
| `ENVIRONMENT` | `production` | New registrations require admin enablement |
|
| 94 |
+
| `LLM_BASE_URL` | `https://api.example.com/v1` | LLM API Base URL (OpenAI-compatible) |
|
| 95 |
| `LLM_MODEL_NAME` | `gpt-5.1` | LLM model name |
|
| 96 |
|
| 97 |
6. **LLM Analysis (optional)**: Set in Space **Settings → Repository secrets**:
|
|
|
|
| 103 |
Demo pre-fills Base URL and model name for OpenAI-compatible calls:
|
| 104 |
|
| 105 |
```python
|
| 106 |
+
import os
|
| 107 |
from openai import OpenAI
|
| 108 |
|
| 109 |
client = OpenAI(
|
| 110 |
+
base_url=os.environ["LLM_BASE_URL"], # e.g. https://api.example.com/v1
|
| 111 |
+
api_key=os.environ["LLM_API_KEY"], # Set in your environment, or in HF Space Secrets
|
| 112 |
)
|
| 113 |
# model: gpt-5.1
|
| 114 |
```
|
|
|
|
| 123 |
- **Flexible annotation configs** — Rating, category, text, single/multi-select, binary; optional reason and confidence fields
|
| 124 |
- **Collaboration and permissions** — Superuser admin dashboard; regular users claim tasks and annotate; JWT auth
|
| 125 |
- **Analysis and export** — Annotation progress and statistics; configurable simplified export
|
| 126 |
+
- **Optional LLM** — OpenAI-compatible Chat API, default `https://api.example.com/v1` + `gpt-5.1`; Token injected via `LLM_API_KEY` env var
|
| 127 |
- **Seed questions** — Predefined question templates organized by type/subtype
|
| 128 |
- **UI language** — Chinese and English (i18n)
|
| 129 |
|
|
|
|
| 366 |
|
| 367 |
## Research and Citation
|
| 368 |
|
| 369 |
+
This platform is the **Expert Validation Platform** component of QALoop. If you use it in a publication, please cite the QALoop DASFAA 2027 Industry Track paper and describe **annotation dimensions and guideline version**, **export format and field meanings**. See the [root README](https://github.com/JackKuo666/QALoop#citation) for BibTeX.
|
| 370 |
|
| 371 |
## Roadmap
|
| 372 |
|
README_zh.md
CHANGED
|
@@ -9,7 +9,7 @@ pinned: false
|
|
| 9 |
|
| 10 |
# QA Annotation System
|
| 11 |
|
| 12 |
-
[QALoop](https://github.com/JackKuo666/QALoop)
|
| 13 |
|
| 14 |
## Demo 使用说明
|
| 15 |
|
|
@@ -91,7 +91,7 @@ git add seed/demo.sql && git commit -m "Update demo seed" && git push space main
|
|
| 91 |
|----------|--------|------|
|
| 92 |
| `DB_DIR` | `/data` | SQLite 数据目录(Dockerfile 已默认设为 `/data`) |
|
| 93 |
| `ENVIRONMENT` | `production` | 新注册用户需管理员启用 |
|
| 94 |
-
| `LLM_BASE_URL` | `
|
| 95 |
| `LLM_MODEL_NAME` | `gpt-5.1` | LLM 模型名称 |
|
| 96 |
|
| 97 |
6. **LLM 分析(可选)**:在 Space **Settings → Repository secrets** 中设置:
|
|
@@ -103,11 +103,12 @@ git add seed/demo.sql && git commit -m "Update demo seed" && git push space main
|
|
| 103 |
Demo 已预填 Base URL 与模型名,对应 OpenAI 兼容调用:
|
| 104 |
|
| 105 |
```python
|
|
|
|
| 106 |
from openai import OpenAI
|
| 107 |
|
| 108 |
client = OpenAI(
|
| 109 |
-
base_url="
|
| 110 |
-
api_key="
|
| 111 |
)
|
| 112 |
# model: gpt-5.1
|
| 113 |
```
|
|
@@ -122,7 +123,7 @@ client = OpenAI(
|
|
| 122 |
- **灵活标注配置** — 评分、分类、文本、单选/多选、二元;可选理由与置信度字段
|
| 123 |
- **协作与权限** — 超级用户管理后台;普通用户领取任务并标注;JWT 认证
|
| 124 |
- **分析与导出** — 标注进度与统计分析;结果可按配置简化导出
|
| 125 |
-
- **可选 LLM** — OpenAI 兼容 Chat API,默认 `
|
| 126 |
- **种子问题** — 预置问题模板,按类型/子类管理
|
| 127 |
- **界面语言** — 中英文(i18n)
|
| 128 |
|
|
@@ -365,7 +366,7 @@ ruff format .
|
|
| 365 |
|
| 366 |
## 研究与引用
|
| 367 |
|
| 368 |
-
本平台是 QALoop 的 **专家验证平台** 组件。如在论文中使用,请引用 QALoop
|
| 369 |
|
| 370 |
## Roadmap(设想)
|
| 371 |
|
|
|
|
| 9 |
|
| 10 |
# QA Annotation System
|
| 11 |
|
| 12 |
+
[QALoop](https://github.com/JackKuo666/QALoop) 的 **专家验证平台**,对应 DASFAA 2027 Industry Track 投稿中的专家参与领域问答数据生产系统。面向 **QA 数据协作标注与质量管理**:多用户任务流、可配置标注量表、统计与导出,以及可选的 **LLM 辅助阅读标注备注**。接收上游 QA 合成管道产出的候选 QA 对,并将专家判断转化为结构化反馈,驱动管道迭代。
|
| 13 |
|
| 14 |
## Demo 使用说明
|
| 15 |
|
|
|
|
| 91 |
|----------|--------|------|
|
| 92 |
| `DB_DIR` | `/data` | SQLite 数据目录(Dockerfile 已默认设为 `/data`) |
|
| 93 |
| `ENVIRONMENT` | `production` | 新注册用户需管理员启用 |
|
| 94 |
+
| `LLM_BASE_URL` | `https://api.example.com/v1` | LLM API Base URL(OpenAI 兼容) |
|
| 95 |
| `LLM_MODEL_NAME` | `gpt-5.1` | LLM 模型名称 |
|
| 96 |
|
| 97 |
6. **LLM 分析(可选)**:在 Space **Settings → Repository secrets** 中设置:
|
|
|
|
| 103 |
Demo 已预填 Base URL 与模型名,对应 OpenAI 兼容调用:
|
| 104 |
|
| 105 |
```python
|
| 106 |
+
import os
|
| 107 |
from openai import OpenAI
|
| 108 |
|
| 109 |
client = OpenAI(
|
| 110 |
+
base_url=os.environ["LLM_BASE_URL"], # 例如 https://api.example.com/v1
|
| 111 |
+
api_key=os.environ["LLM_API_KEY"], # 在运行环境或 HF Space Secrets 中设置
|
| 112 |
)
|
| 113 |
# model: gpt-5.1
|
| 114 |
```
|
|
|
|
| 123 |
- **灵活标注配置** — 评分、分类、文本、单选/多选、二元;可选理由与置信度字段
|
| 124 |
- **协作与权限** — 超级用户管理后台;普通用户领取任务并标注;JWT 认证
|
| 125 |
- **分析与导出** — 标注进度与统计分析;结果可按配置简化导出
|
| 126 |
+
- **可选 LLM** — OpenAI 兼容 Chat API,默认 `https://api.example.com/v1` + `gpt-5.1`;Token 通过 `LLM_API_KEY` 环境变量注入
|
| 127 |
- **种子问题** — 预置问题模板,按类型/子类管理
|
| 128 |
- **界面语言** — 中英文(i18n)
|
| 129 |
|
|
|
|
| 366 |
|
| 367 |
## 研究与引用
|
| 368 |
|
| 369 |
+
本平台是 QALoop 的 **专家验证平台** 组件。如在论文中使用,请引用 QALoop 的 DASFAA 2027 Industry Track 论文,并说明 **标注维度与指南版本**、**导出格式与字段含义**。BibTeX 见[根目录 README](https://github.com/JackKuo666/QALoop#citation)。
|
| 370 |
|
| 371 |
## Roadmap(设想)
|
| 372 |
|
qa_annotate/config.py
CHANGED
|
@@ -40,7 +40,7 @@ class Settings(BaseSettings):
|
|
| 40 |
|
| 41 |
# LLM 默认配置(可通过环境变量覆盖;API Key 建议用 LLM_API_KEY 注入)
|
| 42 |
LLM_API_KEY: Optional[str] = None
|
| 43 |
-
LLM_BASE_URL: str = "
|
| 44 |
LLM_MODEL_NAME: str = "gpt-5.1"
|
| 45 |
|
| 46 |
model_config = SettingsConfigDict(
|
|
|
|
| 40 |
|
| 41 |
# LLM 默认配置(可通过环境变量覆盖;API Key 建议用 LLM_API_KEY 注入)
|
| 42 |
LLM_API_KEY: Optional[str] = None
|
| 43 |
+
LLM_BASE_URL: str = "https://api.example.com/v1"
|
| 44 |
LLM_MODEL_NAME: str = "gpt-5.1"
|
| 45 |
|
| 46 |
model_config = SettingsConfigDict(
|
qa_annotate/static/js/system-config-management.js
CHANGED
|
@@ -196,7 +196,7 @@
|
|
| 196 |
// ==================== LLM 配置管理 ====================
|
| 197 |
|
| 198 |
const LLM_DEFAULTS = {
|
| 199 |
-
base_url: '
|
| 200 |
model_name: 'gpt-5.1',
|
| 201 |
};
|
| 202 |
|
|
|
|
| 196 |
// ==================== LLM 配置管理 ====================
|
| 197 |
|
| 198 |
const LLM_DEFAULTS = {
|
| 199 |
+
base_url: 'https://api.example.com/v1',
|
| 200 |
model_name: 'gpt-5.1',
|
| 201 |
};
|
| 202 |
|
qa_annotate/static/locales/en-US.json
CHANGED
|
@@ -684,7 +684,7 @@
|
|
| 684 |
"llmBaseUrl": "Base URL",
|
| 685 |
"llmModelName": "Model Name",
|
| 686 |
"llmApiKeyPlaceholder": "Set via LLM_API_KEY environment variable",
|
| 687 |
-
"llmBaseUrlPlaceholder": "
|
| 688 |
"llmModelNamePlaceholder": "gpt-5.1",
|
| 689 |
"llmConfigValue": "Current Value:",
|
| 690 |
"llmConfigNotSet": "Not configured",
|
|
|
|
| 684 |
"llmBaseUrl": "Base URL",
|
| 685 |
"llmModelName": "Model Name",
|
| 686 |
"llmApiKeyPlaceholder": "Set via LLM_API_KEY environment variable",
|
| 687 |
+
"llmBaseUrlPlaceholder": "https://api.example.com/v1",
|
| 688 |
"llmModelNamePlaceholder": "gpt-5.1",
|
| 689 |
"llmConfigValue": "Current Value:",
|
| 690 |
"llmConfigNotSet": "Not configured",
|
qa_annotate/static/locales/zh-CN.json
CHANGED
|
@@ -681,7 +681,7 @@
|
|
| 681 |
"llmBaseUrl": "Base URL",
|
| 682 |
"llmModelName": "模型名称",
|
| 683 |
"llmApiKeyPlaceholder": "通过 LLM_API_KEY 环境变量配置",
|
| 684 |
-
"llmBaseUrlPlaceholder": "
|
| 685 |
"llmModelNamePlaceholder": "gpt-5.1",
|
| 686 |
"llmConfigValue": "当前值:",
|
| 687 |
"llmConfigNotSet": "未配置",
|
|
|
|
| 681 |
"llmBaseUrl": "Base URL",
|
| 682 |
"llmModelName": "模型名称",
|
| 683 |
"llmApiKeyPlaceholder": "通过 LLM_API_KEY 环境变量配置",
|
| 684 |
+
"llmBaseUrlPlaceholder": "https://api.example.com/v1",
|
| 685 |
"llmModelNamePlaceholder": "gpt-5.1",
|
| 686 |
"llmConfigValue": "当前值:",
|
| 687 |
"llmConfigNotSet": "未配置",
|
seed/demo.sql
CHANGED
|
@@ -40,7 +40,6 @@ CREATE TABLE system_configs (
|
|
| 40 |
PRIMARY KEY (id)
|
| 41 |
);
|
| 42 |
INSERT INTO system_configs VALUES(1,'allow_registration','true','是否允许用户注册(true/false)','2026-03-23 14:09:27.427149','2026-03-23 14:09:27.427163');
|
| 43 |
-
INSERT INTO system_configs VALUES(2,'llm_base_url','http://43.159.131.233:3001/v1','LLM API Base URL','2026-04-09 09:32:11.544387','2026-04-09 09:32:11.544400');
|
| 44 |
INSERT INTO system_configs VALUES(3,'llm_model_name','gpt-5.1','LLM Model Name','2026-04-09 09:32:11.677416','2026-04-09 09:32:11.677429');
|
| 45 |
CREATE TABLE users (
|
| 46 |
id INTEGER NOT NULL,
|
|
|
|
| 40 |
PRIMARY KEY (id)
|
| 41 |
);
|
| 42 |
INSERT INTO system_configs VALUES(1,'allow_registration','true','是否允许用户注册(true/false)','2026-03-23 14:09:27.427149','2026-03-23 14:09:27.427163');
|
|
|
|
| 43 |
INSERT INTO system_configs VALUES(3,'llm_model_name','gpt-5.1','LLM Model Name','2026-04-09 09:32:11.677416','2026-04-09 09:32:11.677429');
|
| 44 |
CREATE TABLE users (
|
| 45 |
id INTEGER NOT NULL,
|