This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jina import Client | |
from docarray import Document | |
client = Client("https://8bae9ebaf9.wolf.jina.ai") | |
query = Document(text="Can I catch COVID from my pet armadillo?") | |
search_filter = {"source": {"$eq": "biomedical"}} | |
results = client.search(query, parameters={"filter": search_filter}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docs = DocumentArray.from_csv( | |
"data/community.csv", | |
field_resolver={"question": "text"} | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client = Client(host=<Flow URL>) | |
client.index(docs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jtype: Flow | |
with: | |
protocol: http # remove the port | |
executors: | |
- name: encoder | |
uses: jinahub+docker://SpacyTextEncoder/v0.4 # run everything in docker | |
uses_with: | |
model_name: 'en_core_web_md' | |
replicas: 2 # 2 replicas for faster encoding | |
resources: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jina import Client | |
from docarray import Document | |
client = Client(host='localhost', port=23456) | |
query = Document(text="Can I catch COVID from my pet armadillo?") | |
search_filter = {"source": {"$eq": "biomedical"}} | |
results = client.search(query, parameters={"filter": search_filter}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jina import Client | |
from docarray import Document | |
client = Client(host='localhost', port=23456) | |
query = Document(text="Can I catch COVID from my pet armadillo?") | |
results = client.search(query) | |
for result in results: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flow = Flow.load_config("flow.yml") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jtype: Flow | |
with: | |
protocol: http | |
port: 23456 | |
executors: | |
- name: encoder | |
uses: jinahub+docker://SpacyTextEncoder/v0.4 | |
uses_with: | |
model_name: 'en_core_web_md' | |
install_requirements: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jtype: Flow | |
with: | |
protocol: http | |
port: 23456 | |
executors: | |
- name: encoder | |
uses: jinahub+://SpacyTextEncoder/v0.4 | |
uses_with: | |
model_name: 'en_core_web_md' | |
install_requirements: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jtype: Flow | |
with: | |
protocol: http | |
executors: | |
- name: encoder | |
uses: jinahub+docker://CLIPEncoder | |
resources: | |
memory: 8G | |
- name: tensor_deleter | |
uses: jinahub+docker://TensorDeleter |