|
|
@ -18,7 +18,7 @@ This operator select input list by simply aggregating, sorting and then filterin |
|
|
|
For two input lists: video urls and scores, aggregate url by reduce_function, then sort aggregated scores, then select top k results. |
|
|
|
|
|
|
|
```python |
|
|
|
from towhee.dc2 import pipe, ops, DataCollection |
|
|
|
from towhee import pipe, ops, DataCollection |
|
|
|
|
|
|
|
p = ( |
|
|
|
pipe.input('video_urls', 'scores') \ |
|
|
@ -32,7 +32,7 @@ DataCollection(p(['a', 'a', 'c', 'a', 'b', 'b', 'c', 'c'], [2, 8, 9.3, 5, 2, 1, |
|
|
|
![](mean.png) |
|
|
|
|
|
|
|
```python |
|
|
|
from towhee.dc2 import pipe, ops, DataCollection |
|
|
|
from towhee import pipe, ops, DataCollection |
|
|
|
|
|
|
|
p = ( |
|
|
|
pipe.input('video_urls', 'scores') \ |
|
|
@ -45,7 +45,7 @@ DataCollection(p(['a', 'a', 'c', 'a', 'b', 'b', 'c', 'c'], [2, 8, 9.3, 5, 2, 1, |
|
|
|
![](mean.png) |
|
|
|
|
|
|
|
```python |
|
|
|
from towhee.dc2 import pipe, ops, DataCollection |
|
|
|
from towhee import pipe, ops, DataCollection |
|
|
|
|
|
|
|
p = ( |
|
|
|
pipe.input('video_urls', 'scores') \ |
|
|
@ -60,7 +60,7 @@ DataCollection(p(['a', 'a', 'c', 'a', 'b', 'b', 'c', 'c'], [2, 8, 9.3, 5, 2, 1, |
|
|
|
|
|
|
|
|
|
|
|
```python |
|
|
|
from towhee.dc2 import pipe, ops, DataCollection |
|
|
|
from towhee import pipe, ops, DataCollection |
|
|
|
|
|
|
|
p = ( |
|
|
|
pipe.input('video_urls', 'scores') \ |
|
|
|