Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Neural Search - From Prototype to Production with Jina

You're reading from  Neural Search - From Prototype to Production with Jina

Product type Book
Published in Oct 2022
Publisher Packt
ISBN-13 9781801816823
Pages 188 pages
Edition 1st Edition
Languages
Authors (6):
Jina AI Jina AI
Profile icon Jina AI
Bo Wang Bo Wang
Profile icon Bo Wang
Cristian Mitroi Cristian Mitroi
Profile icon Cristian Mitroi
Feng Wang Feng Wang
Profile icon Feng Wang
Shubham Saboo Shubham Saboo
Profile icon Shubham Saboo
Susana Guzmán Susana Guzmán
Profile icon Susana Guzmán
View More author details

Table of Contents (13) Chapters

Preface Part 1: Introduction to Neural Search Fundamentals
Chapter 1: Neural Networks for Neural Search Chapter 2: Introducing Foundations of Vector Representation Chapter 3: System Design and Engineering Challenges Part 2: Introduction to Jina Fundamentals
Chapter 4: Learning Jina’s Basics Chapter 5: Multiple Search Modalities Part 3: How to Use Jina for Neural Search
Chapter 6: Building Practical Examples with Jina Chapter 7: Exploring Advanced Use Cases of Jina Index Other Books You May Enjoy

Flow

Now that you know what Documents and Executors are and how to work with them, we can start to talk about Flow, one of the most important concepts in Jina.

Think of Flow as a manager in Jina; it takes care of all the tasks that will run on your application and will use Documents as its input and output.

Creating a Flow

The creation of a Flow in Jina is very easy and works just like any other object in Python. For example, this is how you would create an empty Flow:

from jina import Flow
f = Flow()

In order to use a Flow, it’s best to always open it as a context manager, just like you would open a file in Python, by using the with function:

from jina import Flow
f = Flow()
with f:     
f.block()

Note

Flow follows a lazy construction pattern: it won’t actually run unless you use the with function to open it.

Adding Executors to a Flow

To add elements to your Flow, all you need to do is use the .add() method. You...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}