<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: andre</title>
    <description>The latest articles on DEV Community by andre (@andre_z).</description>
    <link>https://dev.to/andre_z</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F308719%2F03fcdb51-90d8-4dff-af07-361906d4247c.jpeg</url>
      <title>DEV Community: andre</title>
      <link>https://dev.to/andre_z</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andre_z"/>
    <language>en</language>
    <item>
      <title>Neural Search Tutorial. Part 2.</title>
      <dc:creator>andre</dc:creator>
      <pubDate>Wed, 23 Feb 2022 19:39:10 +0000</pubDate>
      <link>https://dev.to/qdrant/neural-search-tutorial-part-2-1k0o</link>
      <guid>https://dev.to/qdrant/neural-search-tutorial-part-2-1k0o</guid>
      <description>&lt;p&gt;In the first part, we've learned about the fundamentals of Neural Search. Let's now start with the hands-on tutorial.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which model could be used?
&lt;/h2&gt;

&lt;p&gt;It is ideal to use a model specially trained to determine the closeness of meanings. For example, models trained on Semantic Textual Similarity (STS) datasets. Current state-of-the-art models could be found on this &lt;a href="https://paperswithcode.com/sota/semantic-textual-similarity-on-sts-benchmark?p=roberta-a-robustly-optimized-bert-pretraining"&gt;leaderboard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;However, not only specially trained models can be used. If the model is trained on a large enough dataset, its internal features can work as embeddings too. So, for instance, you can take any pre-trained on ImageNet model and cut off the last layer from it. In the penultimate layer of the neural network, as a rule, the highest-level features are formed, which, however, do not correspond to specific classes. The output of this layer can be used as an embedding.&lt;/p&gt;

&lt;h2&gt;
  
  
  What tasks is neural search good for?
&lt;/h2&gt;

&lt;p&gt;Neural search has the greatest advantage in areas where the query cannot be formulated precisely. Querying a table in a SQL database is not the best place for neural search.&lt;/p&gt;

&lt;p&gt;On the contrary, if the query itself is fuzzy, or it cannot be formulated as a set of conditions — neural search can help you. If the search query is a picture, sound file or long text, neural network search is almost the only option.&lt;/p&gt;

&lt;p&gt;If you want to build a recommendation system, the neural approach can also be useful. The user’s actions can be encoded in vector space in the same way as a picture or text. And having those vectors, it is possible to find semantically similar users and determine the next probable user actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let’s build our own
&lt;/h2&gt;

&lt;p&gt;With all that said, let’s make our neural network search. As an example, let's make a search for startups by their description. In this demo, we will see the cases when text search works better and the cases when neural network search works better.&lt;br&gt;
We will use data from &lt;a href="https://www.startups-list.com/"&gt;startups-list.com&lt;/a&gt;. Each record contains the name, a paragraph describing the company, the location and a picture. Raw parsed data can be found at &lt;a href="https://storage.googleapis.com/generall-shared-data/startups_demo.json"&gt;this link&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prepare data for neural search
&lt;/h2&gt;

&lt;p&gt;To be able to search for our descriptions in vector space, we must get vectors first. We need to encode the descriptions into a vector representation. As the descriptions are textual data, we can use a pre-trained language model. As mentioned above, for the task of text search there is a whole set of pre-trained models specifically tuned for semantic similarity.&lt;/p&gt;

&lt;p&gt;One of the easiest libraries to work with pre-trained language models, in my opinion, is the &lt;a href="https://github.com/UKPLab/sentence-transformers"&gt;sentence-transformers&lt;/a&gt; by UKPLab. It provides a way to conveniently download and use many pre-trained models, mostly based on transformer architecture. Transformers is not the only architecture suitable for neural search, but for our task, it is quite enough.&lt;/p&gt;

&lt;p&gt;We will use a model called &lt;code&gt;**distilbert-base-nli-stsb-mean-tokens**&lt;/code&gt;. DistilBERT means that the size of this model has been reduced by a special technique compared to the original BERT. This is important for the speed of our service and its demand for resources. The word &lt;code&gt;stsb&lt;/code&gt; in the name means that the model was trained for the Semantic Textual Similarity task.&lt;br&gt;
The complete code for data preparation with detailed comments can be found and run in &lt;a href="https://colab.research.google.com/drive/1kPktoudAP8Tu8n8l-iVMOQhVmHkWV_L9?usp=sharing"&gt;Colab Notebook&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To be continued... &lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>python</category>
    </item>
    <item>
      <title>Neural Search Tutorial. Part 1.</title>
      <dc:creator>andre</dc:creator>
      <pubDate>Wed, 16 Feb 2022 15:47:03 +0000</pubDate>
      <link>https://dev.to/qdrant/neural-search-tutorial-part-1-2p9o</link>
      <guid>https://dev.to/qdrant/neural-search-tutorial-part-1-2p9o</guid>
      <description>&lt;p&gt;Information retrieval technology is one of the main technologies that enabled the modern Internet to exist. These days, search technology is the heart of a variety of applications. From web-pages search to product recommendations. For many years, this technology didn’t get much change until neural networks came into play.&lt;br&gt;
In this tutorial we are going to find answers to these questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is the difference between regular and neural search?&lt;/li&gt;
&lt;li&gt;What neural networks could be used for search?&lt;/li&gt;
&lt;li&gt;In what tasks is neural network search useful?&lt;/li&gt;
&lt;li&gt;How to build and deploy own neural search service step-by-step?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is neural search?
&lt;/h2&gt;

&lt;p&gt;A regular full-text search, such as Google’s, consists of searching for keywords inside a document. For this reason, the algorithm can not take into account the real meaning of the query and documents. Many documents that might be of interest to the user are not found because they use different wording.&lt;/p&gt;

&lt;p&gt;Neural search tries to solve exactly this problem — it attempts to enable searches not by keywords but by meaning. To achieve this, the search works in 2 steps. In the first step, a specially trained neural network encoder converts the query and the searched objects into a vector representation called embeddings. The encoder must be trained so that similar objects, such as texts with the same meaning or alike pictures get a close vector representation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Famvwjmkzjskxgv9lfr3x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Famvwjmkzjskxgv9lfr3x.png" alt="vector search tutorial qdrant" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A neural encoder places cats closer together.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Having this vector representation, it is easy to understand what the second step should be. To find documents similar to the query you now just need to find the nearest vectors. The most convenient way to determine the distance between two vectors is to calculate the cosine distance. The usual Euclidean distance can also be used, but it is not so efficient due to the curse of dimensionality.&lt;/p&gt;

&lt;h3&gt;
  
  
  Which model could be used?
&lt;/h3&gt;

&lt;p&gt;It is ideal to use a model specially trained to determine the closeness of meanings. For example, models trained on Semantic Textual Similarity (STS) datasets. Current state-of-the-art models could be found on this leaderboard.&lt;br&gt;
However, not only specially trained models can be used. If the model is trained on a large enough dataset, its internal features can work as embeddings too. So, for instance, you can take any pre-trained on ImageNet model and cut off the last layer from it. In the penultimate layer of the neural network, as a rule, the highest-level features are formed, which, however, do not correspond to specific classes. The output of this layer can be used as an embedding.&lt;/p&gt;

&lt;h3&gt;
  
  
  What tasks is neural search good for?
&lt;/h3&gt;

&lt;p&gt;Neural search has the greatest advantage in areas where the query cannot be formulated precisely. Querying a table in a SQL database is not the best place for neural search.&lt;br&gt;
On the contrary, if the query itself is fuzzy, or it cannot be formulated as a set of conditions — neural search can help you. If the search query is a picture, sound file or long text, neural network search is almost the only option.&lt;br&gt;
If you want to build a recommendation system, the neural approach can also be useful. The user’s actions can be encoded in vector space in the same way as a picture or text. And having those vectors, it is possible to find semantically similar users and determine the next probable user actions.&lt;/p&gt;

&lt;p&gt;Let's get our hands dirty in the next part of the tutorial.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>python</category>
    </item>
    <item>
      <title>Qdrant raises pre-seed to build the future of open-source neural search technology</title>
      <dc:creator>andre</dc:creator>
      <pubDate>Tue, 15 Feb 2022 18:38:23 +0000</pubDate>
      <link>https://dev.to/qdrant/qdrant-raises-pre-seed-to-build-the-future-of-open-source-neural-search-technology-525n</link>
      <guid>https://dev.to/qdrant/qdrant-raises-pre-seed-to-build-the-future-of-open-source-neural-search-technology-525n</guid>
      <description>&lt;p&gt;Qdrant is a Berlin-based open-source based deep-tech start-up developing the leading neural search technology to bring applied AI solutions to the next level and make &lt;strong&gt;metric learning&lt;/strong&gt; practical. Our flagship product - &lt;strong&gt;neural search engine&lt;/strong&gt; provides a production-ready service with a convenient API to store, search, and manage vectors along with the additional payload. Qdrant engine is tailored to extended filtering support making it useful for all sorts of neural-network or semantic-based matching, recommendations, faceted search, etc. The area of application is quite broad and ranges from semantic search and product recommendations for e-commerce to image recognition and anomaly detection. The main focus is on processing unstructured data.&lt;/p&gt;

&lt;p&gt;We want to announce a €2 million pre-seed round of financing from two European funds: 42CAP, an industry-specialized German fund based in Munich, and IBB Ventures, an early-stage VC fund based in Berlin, joined by several business angels with a deep know-how of the industry. With the investment, we plan to grow the community of early adopters and going to establish our technology as a standard by releasing the major version of its open-source neural search engine later this year.&lt;/p&gt;

&lt;p&gt;Check out our GitHub repository for details: &lt;a href="https://github.com/qdrant/qdrant"&gt;https://github.com/qdrant/qdrant&lt;/a&gt;&lt;br&gt;
PS: &lt;a href="https://qdrant.join.com"&gt;We are looking&lt;/a&gt; for Rust Engineers 🦀 and ML Engineers 😉&lt;/p&gt;

</description>
      <category>news</category>
      <category>startup</category>
    </item>
  </channel>
</rss>
