Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFromExtraction ¶
BuildFromExtraction 将缓存的原始提取结果绑定到当前 chunk 的 ID/DocID
func ContentHash ¶
ContentHash FNV-1a 哈希,将内容映射为 16 字符的十六进制 key
func SetCachedExtraction ¶
func SetCachedExtraction(store core.CacheStore, hashKey string, ext *Extraction) error
SetCachedExtraction 将实体提取结果写入 CacheStore
Types ¶
type ExtractedEntity ¶
ExtractedEntity 提取的实体
type ExtractedRelation ¶
type ExtractedRelation struct {
Subject string `json:"subject"`
Predicate string `json:"predicate"`
Object string `json:"object"`
}
ExtractedRelation 提取的关系
type Extraction ¶
type Extraction struct {
Entities []ExtractedEntity `json:"entities"`
Relations []ExtractedRelation `json:"relations"`
}
Extraction 原始提取结果,与特定 chunk/doc ID 无关 缓存的是"这段文字包含哪些实体和关系"
func GetCachedExtraction ¶
func GetCachedExtraction(store core.CacheStore, hashKey string) (*Extraction, error)
GetCachedExtraction 从 CacheStore 中查询实体提取缓存 返回 nil 表示缓存未命中
Click to show internal directories.
Click to hide internal directories.