mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-15 14:36:47 +00:00
(improvement)(chat) Support semantic understanding, optimize the overall code of the mapper. (#321)
This commit is contained in:
@@ -1,18 +1,28 @@
|
||||
package com.tencent.supersonic.common.util.embedding;
|
||||
|
||||
import com.tencent.supersonic.common.pojo.enums.DictWordType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@Data
|
||||
public class Retrieval {
|
||||
|
||||
private Long id;
|
||||
protected String id;
|
||||
|
||||
private double distance;
|
||||
protected double distance;
|
||||
|
||||
private String query;
|
||||
protected String query;
|
||||
|
||||
private Map<String, String> metadata;
|
||||
protected Map<String, String> metadata;
|
||||
|
||||
|
||||
public static Long getLongId(String id) {
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return null;
|
||||
}
|
||||
String[] split = id.split(DictWordType.NATURE_SPILT);
|
||||
return Long.parseLong(split[0]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user