chore: replace all cn comments to en version by volc api (#313)
This commit is contained in:
@@ -62,7 +62,7 @@ func assertValAs(typ document.TableColumnType, val string) (*document.ColumnData
|
||||
ValTime: ptr.Of(emptyTime),
|
||||
}, nil
|
||||
}
|
||||
// 支持时间戳和时间字符串
|
||||
// Supports timestamp and time string
|
||||
i, err := strconv.ParseInt(val, 10, 64)
|
||||
if err == nil {
|
||||
t := time.Unix(i, 0)
|
||||
@@ -152,7 +152,7 @@ func assertValAsForce(typ document.TableColumnType, val string, nullable bool) *
|
||||
}
|
||||
|
||||
func assertVal(val string) document.ColumnData {
|
||||
// TODO: 先不处理 image
|
||||
// TODO: Do not process images first
|
||||
if val == "" {
|
||||
return document.ColumnData{
|
||||
Type: document.TableColumnTypeUnknown,
|
||||
|
||||
@@ -75,7 +75,7 @@ func parseByRowIterator(iter rowIterator, config *contract.Config, opts ...parse
|
||||
var rowData []*document.ColumnData
|
||||
for j := range row {
|
||||
colSchema, found := rev[j]
|
||||
if !found { // 列裁剪
|
||||
if !found { // column clipping
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ func parseJSON(config *contract.Config) parseFn {
|
||||
}
|
||||
} else {
|
||||
for k := range rawSlices[0] {
|
||||
// init 取首个 json item 中 key 的随机顺序
|
||||
// Init takes the random order of keys in the first json item
|
||||
header = append(header, k)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ func parseByPython(config *contract.Config, storage storage.Storage, ocr ocr.OCR
|
||||
}
|
||||
docs = append(docs, doc)
|
||||
} else {
|
||||
// TODO: 这里有点问题,img label 可能被较短的 chunk size 截断
|
||||
// TODO: There is a problem here, the img label may be truncated by the shorter chunk size
|
||||
result.Content[i+1].Content = label + result.Content[i+1].Content
|
||||
}
|
||||
case contentTypeTable:
|
||||
|
||||
@@ -35,7 +35,7 @@ const imgSrcFormat = `<img src="" data-tos-key="%s">`
|
||||
func createSecret(uid int64, fileType string) string {
|
||||
num := 10
|
||||
input := fmt.Sprintf("upload_%d_Ma*9)fhi_%d_gou_%s_rand_%d", uid, time.Now().Unix(), fileType, rand.Intn(100000))
|
||||
// 做md5,取前20个,// mapIntToBase62 把数字映射到 Base62
|
||||
// Do md5, take the first 20,//mapIntToBase62 map the number to Base62
|
||||
hash := sha256.Sum256([]byte(fmt.Sprintf("%s", input)))
|
||||
hashString := base64.StdEncoding.EncodeToString(hash[:])
|
||||
if len(hashString) > num {
|
||||
|
||||
@@ -27,11 +27,11 @@ package vikingdb
|
||||
// resp, err := r.Rerank(context.Background(), &rerank.Request{
|
||||
// Data: [][]*knowledge.RetrieveSlice{
|
||||
// {
|
||||
// {Slice: &entity.Slice{PlainText: "吉尼斯世界纪录网站数据显示,蓝鲸是目前已知世界上最大的动物,体长可达30米,相当于一架波音737飞机的长度"}},
|
||||
// {Slice: &entity.Slice{PlainText: "一头成年雌性弓头鲸可以长到22米长,而一头雄性鲸鱼可以长到18米长"}},
|
||||
// {Slice: & entity. Slice {PlainText: "According to the Guinness World Records website, the blue whale is currently the largest animal known in the world, with a body length of up to 30 meters, which is equivalent to the length of a Boeing 737 aircraft"}},
|
||||
// {Slice: & entity. Slice {PlainText: "An adult female bowhead whale can grow to 22 meters long, while a male whale can grow to 18 meters long"}},
|
||||
// },
|
||||
// },
|
||||
// Query: "世界上最大的鲸鱼是什么?",
|
||||
// Query: "What is the largest whale in the world?"
|
||||
// TopN: nil,
|
||||
// })
|
||||
// assert.NoError(t, err)
|
||||
@@ -39,8 +39,8 @@ package vikingdb
|
||||
// for _, item := range resp.Sorted {
|
||||
// fmt.Println(item.Slice.PlainText, item.Score)
|
||||
// }
|
||||
// // 吉尼斯世界纪录网站数据显示,蓝鲸是目前已知世界上最大的动物,体长可达30米,相当于一架波音737飞机的长度 0.6209664529733573
|
||||
// // 一头成年雌性弓头鲸可以长到22米长,而一头雄性鲸鱼可以长到18米长 0.4269785303456468
|
||||
// According to the Guinness World Records website, the blue whale is the largest known animal in the world, with a body length of up to 30 meters, which is equivalent to the length of a Boeing 737 aircraft 6209664529733573
|
||||
// //An adult female bowhead whale can grow up to 22 meters long, while a male whale can grow up to 18 meters 4269785303456468
|
||||
//
|
||||
// fmt.Println(resp.TokenUsage)
|
||||
// // 95
|
||||
|
||||
@@ -272,7 +272,7 @@ func (m *milvusManager) convertFields(fields []*searchstore.Field) ([]*mentity.F
|
||||
if f.Type != searchstore.FieldTypeText {
|
||||
return nil, fmt.Errorf("[convertFields] milvus only support text field indexing, field=%s, type=%d", f.Name, f.Type)
|
||||
}
|
||||
// indexing 时只有 content 存储原文
|
||||
// Only content is stored when indexing
|
||||
if f.Name == searchstore.FieldTextContent {
|
||||
resp = append(resp, mentity.NewField().
|
||||
WithName(f.Name).
|
||||
|
||||
@@ -112,7 +112,7 @@ func (v *vkSearchStore) Retrieve(ctx context.Context, query string, opts ...retr
|
||||
return nil, fmt.Errorf("[Retrieve] vikingdb failed to build filter, %w", err)
|
||||
}
|
||||
if filter != nil {
|
||||
// 不支持跨 partition 召回,使用 filter 替代
|
||||
// Cross-partition recall is not supported, use filter instead
|
||||
searchOpts = searchOpts.SetFilter(filter)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user