You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

wordset_upload.go 556 B

1234567891011121314151617181920212223242526272829
  1. package object
  2. import (
  3. "github.com/casbin/casbase/util"
  4. "github.com/casbin/casbase/xlsx"
  5. )
  6. func uploadVectorNames(owner string, fileId string) bool {
  7. table := xlsx.ReadXlsxFile(fileId)
  8. vectors := []*Vector{}
  9. for _, line := range table {
  10. vector := &Vector{
  11. Name: line[0],
  12. Data: []float64{},
  13. }
  14. vectors = append(vectors, vector)
  15. }
  16. wordset := &Wordset{
  17. Owner: owner,
  18. Name: "word",
  19. CreatedTime: util.GetCurrentTime(),
  20. DisplayName: "word",
  21. Distance: 100,
  22. Vectors: vectors,
  23. }
  24. return AddWordset(wordset)
  25. }

基于Casbin的开源AI领域知识库平台

Contributors (1)