mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
修复同一模型被多个数据集引用时: (#2183)
This commit is contained in:
@@ -22,4 +22,9 @@ public abstract class MapResult implements Serializable {
|
|||||||
return this.getMapKey().equals(otherResult.getMapKey())
|
return this.getMapKey().equals(otherResult.getMapKey())
|
||||||
&& this.similarity < otherResult.similarity;
|
&& this.similarity < otherResult.similarity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean lessOrEqualSimilar(MapResult otherResult) {
|
||||||
|
return this.getMapKey().equals(otherResult.getMapKey())
|
||||||
|
&& this.similarity <= otherResult.similarity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ public class MetaEmbeddingService {
|
|||||||
return dataSetIds.stream().map(dataSetId -> {
|
return dataSetIds.stream().map(dataSetId -> {
|
||||||
Retrieval newRetrieval = new Retrieval();
|
Retrieval newRetrieval = new Retrieval();
|
||||||
BeanUtils.copyProperties(retrieval, newRetrieval);
|
BeanUtils.copyProperties(retrieval, newRetrieval);
|
||||||
|
HashMap<String, Object> newMetadata = new HashMap<>(retrieval.getMetadata());
|
||||||
|
newRetrieval.setMetadata(newMetadata);
|
||||||
newRetrieval.getMetadata().putIfAbsent("dataSetId",
|
newRetrieval.getMetadata().putIfAbsent("dataSetId",
|
||||||
dataSetId + Constants.UNDERLINE);
|
dataSetId + Constants.UNDERLINE);
|
||||||
return newRetrieval;
|
return newRetrieval;
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ public abstract class BaseMatchStrategy<T extends MapResult> implements MatchStr
|
|||||||
for (T oneRoundResult : oneRoundResults) {
|
for (T oneRoundResult : oneRoundResults) {
|
||||||
if (existResults.contains(oneRoundResult)) {
|
if (existResults.contains(oneRoundResult)) {
|
||||||
boolean isDeleted = existResults.removeIf(existResult -> {
|
boolean isDeleted = existResults.removeIf(existResult -> {
|
||||||
boolean delete = existResult.lessSimilar(oneRoundResult);
|
// boolean delete = existResult.lessSimilar(oneRoundResult);
|
||||||
|
boolean delete = existResult.lessOrEqualSimilar(oneRoundResult);
|
||||||
if (delete) {
|
if (delete) {
|
||||||
log.debug("deleted existResult:{}", existResult);
|
log.debug("deleted existResult:{}", existResult);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user