mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-10-04 00:03:59 +00:00
- 重写 extractor.go: 分句、17条 POS 模板、依存模板 + COO 链、ATT合并 - parser.go: 分句循环 + TransE 向量验证(h+r≈t) - fallback.go: jieba POS 降级解析器 - bridge.go: nlp.Triple ↔ memory.Triple 转换 - pipeline.go: extractKeyTriples 改用 NLP 提取器, 删除5条旧前缀规则 - distill.go: docToTriples 改用 NLP 提取器 - reorgGraph: 语义相似度增强检测, 保持纯 LLM 决断 - Provider 接口加 MaxContextTokens() + 模型窗口映射表 - tokenbudget.go: 中文 token 估算器 + budget 分配(80%利用率) - process.go/buildSystemPrompt: 按 token 预算截断 memory+timeline
29 lines
653 B
Go
29 lines
653 B
Go
//go:build !onnxruntime
|
|
|
|
package nlp
|
|
|
|
import "fmt"
|
|
|
|
// ONNXParserStub 占位 — 编译时未启用 onnxruntime
|
|
type ONNXParser struct{}
|
|
|
|
type ONNXConfig struct {
|
|
ModelPath string
|
|
VocabPath string
|
|
POSVocPath string
|
|
}
|
|
|
|
func NewONNXParser(cfg ONNXConfig) (*ONNXParser, error) {
|
|
return nil, fmt.Errorf("onnxparser: build with -tags onnxruntime to enable")
|
|
}
|
|
|
|
func (p *ONNXParser) Close() {}
|
|
|
|
func (p *ONNXParser) Parse(text string) (*ParseResult, error) {
|
|
return nil, fmt.Errorf("onnxparser: not available (build with -tags onnxruntime)")
|
|
}
|
|
|
|
func (p *ONNXParser) EnsureModel(dataDir string) error {
|
|
return fmt.Errorf("onnxparser: not available")
|
|
}
|