@exulu/backend 0.3.9 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +0 -13
- package/dist/index.js +0 -13
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1389,10 +1389,6 @@ var calculateStatistics = (items, method) => {
|
|
|
1389
1389
|
if (method === "cosineDistance") {
|
|
1390
1390
|
methodProperty = "cosine_distance";
|
|
1391
1391
|
}
|
|
1392
|
-
const sorted = items.sort((a, b) => a[methodProperty] - b[methodProperty]);
|
|
1393
|
-
const median = sorted[Math.floor(items.length / 2)];
|
|
1394
|
-
const max = sorted[sorted.length - 1];
|
|
1395
|
-
const min = sorted[0];
|
|
1396
1392
|
const average = items.reduce((acc, item) => {
|
|
1397
1393
|
return acc + item[methodProperty];
|
|
1398
1394
|
}, 0) / items.length;
|
|
@@ -1400,9 +1396,6 @@ var calculateStatistics = (items, method) => {
|
|
|
1400
1396
|
return acc + item[methodProperty];
|
|
1401
1397
|
}, 0);
|
|
1402
1398
|
return {
|
|
1403
|
-
max,
|
|
1404
|
-
min,
|
|
1405
|
-
median,
|
|
1406
1399
|
average,
|
|
1407
1400
|
total
|
|
1408
1401
|
};
|
|
@@ -1774,15 +1767,9 @@ var ExuluContext = class {
|
|
|
1774
1767
|
return;
|
|
1775
1768
|
}
|
|
1776
1769
|
const {
|
|
1777
|
-
max,
|
|
1778
|
-
min,
|
|
1779
|
-
median,
|
|
1780
1770
|
average,
|
|
1781
1771
|
total
|
|
1782
1772
|
} = calculateStatistics(item.chunks, method ?? "cosineDistance");
|
|
1783
|
-
item.maxRelevance = max;
|
|
1784
|
-
item.minRelevance = min;
|
|
1785
|
-
item.medianRelevance = median;
|
|
1786
1773
|
item.averageRelevance = average;
|
|
1787
1774
|
item.totalRelevance = total;
|
|
1788
1775
|
});
|
package/dist/index.js
CHANGED
|
@@ -1345,10 +1345,6 @@ var calculateStatistics = (items, method) => {
|
|
|
1345
1345
|
if (method === "cosineDistance") {
|
|
1346
1346
|
methodProperty = "cosine_distance";
|
|
1347
1347
|
}
|
|
1348
|
-
const sorted = items.sort((a, b) => a[methodProperty] - b[methodProperty]);
|
|
1349
|
-
const median = sorted[Math.floor(items.length / 2)];
|
|
1350
|
-
const max = sorted[sorted.length - 1];
|
|
1351
|
-
const min = sorted[0];
|
|
1352
1348
|
const average = items.reduce((acc, item) => {
|
|
1353
1349
|
return acc + item[methodProperty];
|
|
1354
1350
|
}, 0) / items.length;
|
|
@@ -1356,9 +1352,6 @@ var calculateStatistics = (items, method) => {
|
|
|
1356
1352
|
return acc + item[methodProperty];
|
|
1357
1353
|
}, 0);
|
|
1358
1354
|
return {
|
|
1359
|
-
max,
|
|
1360
|
-
min,
|
|
1361
|
-
median,
|
|
1362
1355
|
average,
|
|
1363
1356
|
total
|
|
1364
1357
|
};
|
|
@@ -1730,15 +1723,9 @@ var ExuluContext = class {
|
|
|
1730
1723
|
return;
|
|
1731
1724
|
}
|
|
1732
1725
|
const {
|
|
1733
|
-
max,
|
|
1734
|
-
min,
|
|
1735
|
-
median,
|
|
1736
1726
|
average,
|
|
1737
1727
|
total
|
|
1738
1728
|
} = calculateStatistics(item.chunks, method ?? "cosineDistance");
|
|
1739
|
-
item.maxRelevance = max;
|
|
1740
|
-
item.minRelevance = min;
|
|
1741
|
-
item.medianRelevance = median;
|
|
1742
1729
|
item.averageRelevance = average;
|
|
1743
1730
|
item.totalRelevance = total;
|
|
1744
1731
|
});
|