<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[AI Process Automation - Medium]]></title>
        <description><![CDATA[We explore tools, strategies, and insights to help businesses automate processes and manage documents efficiently — boosting productivity, reducing errors, and transforming workflows. - Medium]]></description>
        <link>https://medium.com/ubiai-nlp?source=rss----8ee3d32a60e5---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>AI Process Automation - Medium</title>
            <link>https://medium.com/ubiai-nlp?source=rss----8ee3d32a60e5---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 00:34:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/ubiai-nlp" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Fine-Tuning LLAMA 3 Model for Relation Extraction Using UbiAI]]></title>
            <link>https://medium.com/ubiai-nlp/fine-tuning-llama-3-model-for-relation-extraction-using-ubiai-data-1fd1946a62e0?source=rss----8ee3d32a60e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/1fd1946a62e0</guid>
            <category><![CDATA[relation-extraction]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[llama-3]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Walid Amamou]]></dc:creator>
            <pubDate>Tue, 13 Aug 2024 02:00:26 GMT</pubDate>
            <atom:updated>2024-11-12T19:20:57.872Z</atom:updated>
            <content:encoded><![CDATA[<p>Extracting meaningful relationships from unstructured text has gained critical importance. This article examines the process of fine-tuning Large Language Models (LLMs), particularly <a href="https://ubiai.tools/fine-tuning-llama-3-model-for-relation-extraction-using-ubiai-data-2/">LLAMA 3</a>, for Relation Extraction tasks. We will discuss how to utilize data annotated with <a href="https://ubiai.tools/fine-tuning/">UbiAI LLM Fine-tunig</a>, a state-of-the-art annotation platform, to boost the model’s efficiency in identifying and classifying semantic relationships within the text.</p><h3>What is Relation Extraction?</h3><p>Relation Extraction is a leading task in NLP, acting as a crucial link between unstructured text and structured knowledge. This process entails identifying entities within a text and determining the semantic relationships that connect them. For example, in the sentence “Tesla, founded by Elon Musk, is revolutionizing the electric vehicle industry,” a relation extraction system would recognize the entities “Tesla,” “Elon Musk,” and “electric vehicle industry,” and extract relationships such as “founded by” and “revolutionizing.”</p><h3>Large Language Models (LLMs)</h3><p>The advent of Large Language Models has ushered in a new era of NLP capabilities. These sophisticated models, trained on vast corpora of text, possess an intrinsic understanding of language structures and semantics. LLAMA 3, a state-of-the-art LLM, exemplifies this power with its ability to comprehend and generate human-like text across diverse domains. By fine-tuning LLAMA 3 for relation extraction, we can leverage its deep language understanding to extract nuanced relationships from text with unprecedented accuracy.</p><h3>Data Preparation for Fine-Tuning</h3><p><strong>Preparing Data: The UBIAI Advantage</strong></p><p>At the heart of any successful machine learning project lies high-quality data. This is where UBIAI shines as a game-changing annotation platform. UBIAI goes beyond traditional annotation tools by offering:</p><ol><li><strong>Advanced Document Processing</strong>: UBIAI excels in extracting text from various document formats, maintaining structural integrity and contextual information crucial for relation extraction tasks.</li><li><strong>Intuitive Annotation Interface</strong>: The platform provides a user-friendly environment for annotators to effortlessly identify entities and define relationships, ensuring consistent and accurate labeling.</li><li><strong>Quality Control Mechanisms</strong>: UBIAI incorporates built-in validation tools and inter-annotator agreement features, significantly enhancing the reliability of the annotated dataset.</li><li><strong>Customizable Annotation Schemas</strong>: Users can define custom entity types and relationship categories, tailoring the annotation process to specific domains or use cases.</li><li><strong>Collaborative Workflows</strong>: UBIAI supports team-based annotation projects, allowing for efficient distribution of tasks and seamless collaboration among annotators.</li></ol><p>By leveraging UBIAI’s powerful features, researchers and data scientists can create high-fidelity datasets specifically designed for training relation extraction models. This meticulously annotated data serves as the foundation for fine-tuning LLAMA 3, enabling it to excel in extracting complex relationships from text across various domains.</p><p><strong>Data Preprocessing</strong></p><p>After exporting the annotated data from UBIAI in JSON format, it needs to be preprocessed to match the format required for fine-tuning the LLAMA 3 model. Here’s a Python script that demonstrates this process:</p><pre>import json<br>import pandas as pd<br><br>def preprocess_json(data, possible_relationships):<br>    # Extract the relevant information<br>    document = data[&#39;document&#39;]<br>    tokens = data[&#39;tokens&#39;]<br>    relations = data[&#39;relations&#39;]<br><br>    # Create a mapping of token index to its text and entity label<br>    token_info = {i: {&#39;text&#39;: t[&#39;text&#39;], &#39;label&#39;:     t[&#39;entityLabel&#39;]} for i, t in enumerate(tokens)}<br><br># Format the entities and relationships<br>    entities = [(t[&#39;text&#39;], t[&#39;entityLabel&#39;]) for t in tokens]<br>    formatted_entities = &quot;, &quot;.join([f&quot;{text} ({label})&quot; for text, label in entities])<br><br>    formatted_relations = []<br>    for r in relations:<br>        child_index = r[&#39;child&#39;]<br>        head_index = r[&#39;head&#39;]<br><br>        if child_index &lt; len(tokens) and head_index &lt; len(tokens):<br>            child = token_info[child_index][&#39;text&#39;]<br>            head = token_info[head_index][&#39;text&#39;]<br><br> relation_label = r[&#39;relationLabel&#39;]<br>            formatted_relations.append(f&quot;{child} -&gt; {head} ({relation_label})&quot;)<br><br>    formatted_relations = &quot;; &quot;.join(formatted_relations)<br><br>    # Create the formatted prompt and response<br>    prompt = f&quot;systemExtract relationships between entities from the following text.user Text: \&quot;{document}\&quot; Entities: {formatted_entities}. Possible relationships: {&#39;, &#39;.join(possible_relationships)}.&quot;<br>    response = f&quot;assistantThe relations between the entities: {formatted_relations}&quot;<br>    full_prompt = prompt + response<br>    return full_prompt<br><br># List of possible relationships (customize as needed)<br>possible_relationships = [&quot;MUST_HAVE&quot;, &quot;REQUIRES&quot;, &quot;NICE_TO_HAVE&quot;]<br><br>input_path = &quot;/content/UBIAI_REL_data.json&quot;<br># Read the input JSON file<br>with open(input_path, &#39;r&#39;) as file:<br>     data = json.load(file)<br><br># Preprocess all JSON strings<br>data = [preprocess_json(j, possible_relationships) for j in data]<br><br># Convert to a DataFrame<br>df = pd.DataFrame(data, columns=[&quot;text&quot;])<br><br># Save to CSV<br>df.to_csv(&#39;fine_tuning_data.csv&#39;, index=False)<br></pre><p>Got it! The script I provided formats the data into prompt-response pairs suitable for fine-tuning models like LLAMA 3. If you have any more questions or need further assistance with this or any other task, feel free to ask!</p><h3>Fine-Tuning LLAMA 3</h3><p>To fine-tune the LLAMA 3 model for relation extraction, you’ll typically use libraries like Hugging Face’s Transformers library in Python. Here’s a basic setup to get you started:</p><pre>import torch<br>from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig<br>from peft import prepare_model_for_kbit_training, LoraConfig<br>from trl import setup_chat_format<br><br>model_id = &quot;meta-llama/Meta-Llama-3-8B&quot;<br><br># Tokenizer setup<br>tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=True, trust_remote_code=True)<br><br>tokenizer.pad_token = tokenizer.eos_token<br>tokenizer.pad_token_id = tokenizer.eos_token_id<br>tokenizer.padding_side = &#39;left&#39;<br>tokenizer.model_max_length = 2048<br><br># Quantization configuration<br>bnb_config = BitsAndBytesConfig(<br>    load_in_4bit=True,<br>    bnb_4bit_use_double_quant=True,<br>    bnb_4bit_quant_type=&quot;nf4&quot;,<br>    bnb_4bit_compute_dtype=torch.float16<br>)<br><br># Model setup<br>device_map = {&quot;&quot;: torch.cuda.current_device()} if torch.cuda.is_available() else None<br>model = AutoModelForCausalLM.from_pretrained(<br>    model_id,<br>    device_map=device_map,<br>    quantization_config=bnb_config<br>)<br><br>model, tokenizer = setup_chat_format(model, tokenizer)<br>model = prepare_model_for_kbit_training(model)<br><br># LoRA configuration<br><br>peft_config = LoraConfig(<br>    lora_alpha=128,<br>    lora_dropout=0.05,<br>    r=256,<br>    bias=&quot;none&quot;,<br>    target_modules=[&quot;q_proj&quot;, &quot;o_proj&quot;, &quot;gate_proj&quot;, &quot;up_proj&quot;, &quot;down_proj&quot;, &quot;k_proj&quot;, &quot;v_proj&quot;],<br>    task_type=&quot;CAUSAL_LM&quot;,)<br></pre><p>This code sets up the LLAMA 3 model with 4-bit quantization and LoRA (Low-Rank Adaptation) for efficient fine-tuning.</p><p><strong>Training Configuration</strong></p><p>Next, we set up the training arguments:</p><pre>from transformers import TrainingArguments<br><br>args = TrainingArguments(<br>    output_dir=&quot;sft_model_path&quot;,<br>    num_train_epochs=1,<br>    per_device_train_batch_size=4,<br>    gradient_accumulation_steps=2,<br>    gradient_checkpointing=True,<br>    optim=&quot;adamw_8bit&quot;,<br>    logging_steps=10,<br>    save_strategy=&quot;epoch&quot;,<br>    Learning_rate=2e-4,<br>    bf16=True,<br>    tf32=True,<br>    max_grad_norm=0.3,<br>    warmup_ratio=0.03,<br>    lr_scheduler_type=&quot;constant&quot;,<br>    report_to=&quot;tensorboard&quot;,)</pre><p>These arguments define various aspects of the training process, such as the number of epochs, batch size, learning rate, and optimization strategy.</p><p><strong>Training the Model</strong></p><p>Now we can set up the trainer and start the fine-tuning process:</p><pre>from trl import SFTTrainer<br><br>trainer = SFTTrainer(<br>    model=model,<br>    args=args,<br>    train_dataset=dataset,<br>    peft_config=peft_config,<br>    max_seq_length=512,<br>    tokenizer=tokenizer,<br>    dataset_text_field=&quot;text&quot;,<br>    packing=False,<br>    dataset_kwargs={<br>        &quot;add_special_tokens&quot;: False,<br>        &quot;append_concat_token&quot;: False,<br>    }<br>)<br>trainer.train()<br>trainer.save_model()</pre><p>This code initializes the SFTTrainer (Supervised Fine-Tuning Trainer) and begins the training process. After fine-tuning, the script merges the newly learned weights with the base model.</p><pre>from peft import PeftModel<br><br>base_model = &quot;meta-llama/Meta-Llama-3-8B&quot;<br>new_model = &quot;/content/REL_finetuned_llm&quot;<br><br>base_model_reload = AutoModelForCausalLM.from_pretrained(<br>    base_model,<br>    return_dict=True,<br>    torch_dtype=torch.float16,<br>    trust_remote_code=True,<br>)<br><br>base_model_reload, tokenizer = setup_chat_format(base_model_reload, tokenizer)<br><br>model = PeftModel.from_pretrained(base_model_reload, new_model)<br>model = model.merge_and_unload()<br><br>model.save_pretrained(&quot;llama-3-8b-REL&quot;)<br>tokenizer.save_pretrained(&quot;llama-3-8b-REL&quot;)</pre><p>This code loads the base model, applies the fine-tuned weights, and saves the merged model.</p><h3>Inference</h3><p>Finally, we can use the fine-tuned model for inference:</p><pre>messages = [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;&quot;&quot;Extract relationships between entities from the following text. Text: &quot;1+ years development experience on Java stack AppConnect / API&#39;s experience is added advantage. Compute, Network and Storage Monitoring Tools (Ex: Netcool) Application Performance Tools (IBM APM) Cloud operations and Automation Tools (VmWare, ICAM, ...) Proven Record of developing enterprise class products and applications. Preferred Tech and Prof Experience None EO Statement IBM is committed to creating a diverse environment and is proud to be an equal opportunity employer. All qualified applicants will receive consideration for employment without regard to race, color, religion, gender, gender identity or expression, sexual orientation, national origin, genetics, disability, age, or veteran status. IBM is also committed to compliance with all fair employment practices regarding citizenship and immigration status. .&quot; Entities: 1+ years (EXPERIENCE), development (SKILLS). Possible relationships: EXPERIENCE_IN, LOCATED_IN, WORKS_FOR, PART_OF, CREATED_BY.&quot;&quot;&quot;}]<br><br>prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)<br>pipe = pipeline(<br>    &quot;text-generation&quot;,<br>    model=model,<br>    tokenizer=tokenizer,<br>    torch_dtype=torch.float16,<br>    device_map=&quot;auto&quot;,<br>)<br><br>outputs = pipe(prompt, max_new_tokens=120, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)<br>print(outputs[0][&quot;generated_text&quot;])</pre><p>Here’s the reformulated version:</p><p><strong>Output:</strong> 1+ years (Experience) -&gt; development (Skills) (Experience_In)</p><p>This tutorial has illustrated how to utilize a fine-tuned model to extract relationships from text.</p><h3>Conclusion</h3><p>Fine-tuning LLAMA 3 for relation extraction involves several key steps, including data annotation, preprocessing, model setup, fine-tuning, and inference. By following this guide, you can harness LLAMA 3’s capabilities to extract meaningful relationships from your text data. LLAMA 3’s flexibility and robustness make it well-suited for various NLP tasks, including relation extraction.</p><p>This tutorial has showcased the end-to-end process using data annotated in <a href="https://ubiai.tools/fine-tuning/">UBIAI</a>. It demonstrates how advanced language models can transform raw text into structured information. The combination of UBIAI’s annotation capabilities and LLAMA 3’s powerful language understanding offers a potent tool for extracting valuable insights from unstructured text data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fd1946a62e0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubiai-nlp/fine-tuning-llama-3-model-for-relation-extraction-using-ubiai-data-1fd1946a62e0">Fine-Tuning LLAMA 3 Model for Relation Extraction Using UbiAI</a> was originally published in <a href="https://medium.com/ubiai-nlp">AI Process Automation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating Knowledge Graphs into the RAG Stack in 2024]]></title>
            <link>https://medium.com/ubiai-nlp/integrating-knowledge-graphs-into-the-rag-stack-in-2024-7dba1c0749c2?source=rss----8ee3d32a60e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/7dba1c0749c2</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Walid Amamou]]></dc:creator>
            <pubDate>Tue, 13 Aug 2024 00:27:48 GMT</pubDate>
            <atom:updated>2024-08-13T00:27:47.959Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BEDSIwpXVYW5_tQuUXxwUQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@alinnnaaaa?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Alina Grubnyak</a> on <a href="https://unsplash.com/photos/low-angle-photography-of-metal-structure-ZiQkhI7417A?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>In the rapidly evolving field of artificial intelligence, integrating various technologies to enhance performance and capabilities is a primary focus. One such integration is the combination of Knowledge Graphs (KGS) with the Retrieval-Augmented Generation (<a href="https://ubiai.tools/integrating-knowledge-graphs-into-the-rag-stack/">RAG</a>) Stack. Knowledge Graphs provide a structured representation of information, capturing relationships and entities in a format that is both human-readable and machine-processable. The RAG Stack, on the other hand, enhances generative models by incorporating information retrieval processes, resulting in more accurate and contextually relevant responses.</p><p>This article explores the components and benefits of Knowledge Graphs, explains the workings of the RAG Stack, and offers a detailed guide on how to integrate these technologies to create a more powerful AI system.</p><h3>Understanding Knowledge Graphs</h3><h3>Definition and Components</h3><h3>1.1. What are Knowledge Graphs?</h3><p>Knowledge Graphs (KGS) are structured representations of information that capture relationships and entities in a format that is both human-readable and machine-processable. They are designed to integrate, manage, and retrieve knowledge from diverse data sources, creating a network of interconnected data points that represent real-world entities and their relationships.</p><h3>1.2. Key Components of Knowledge Graphs</h3><p><strong>Entities:</strong> Entities are the primary nodes in a knowledge graph representing real-world objects, concepts, or things. Each entity has a unique identifier and attributes that describe its properties.</p><p><strong>Relationships:</strong> Relationships (also called edges or links) connect entities in a knowledge graph, indicating how they are related to each other.</p><p><strong>Attributes:</strong> Attributes (also called properties) are data points that describe specific characteristics of an entity.</p><h3>Applications and Benefits</h3><h3>2.1. How are Knowledge Graphs Used in Various Domains?</h3><p><strong>Search Engines:</strong> Knowledge Graphs enhance search engines by providing more accurate and contextually relevant results. They enable search engines to understand the relationships between different pieces of information and provide users with comprehensive answers.</p><p><em>Example:</em> Google’s Knowledge Graph powers its search feature, offering users direct answers to queries instead of just a list of links.</p><p><strong>Healthcare:</strong> In healthcare, Knowledge Graphs integrate and organize medical information from various sources, facilitating advanced research, personalized treatment plans, and improved patient care.</p><p><em>Example:</em> Knowledge Graphs can link symptoms to diseases, treatments, and medical research, aiding in diagnosis and treatment recommendations.</p><p><strong>Finance:</strong> Financial institutions use Knowledge Graphs to analyze complex relationships between entities like companies, financial instruments, and market events. This helps in risk assessment, fraud detection, and investment strategies.</p><p><strong>Customer Support:</strong> Knowledge Graphs power virtual assistants and chatbots, enabling them to understand and respond to customer inquiries with precise and contextually relevant information.</p><h3>2.2. Benefits of Using Knowledge Graphs</h3><ul><li>Improved Data Interlinking</li><li>Enhanced Information Retrieval</li><li>Better Decision-Making</li><li>Scalability and Flexibility</li></ul><h3>Introduction to the RAG Stack</h3><h4>What is the RAG Stack?</h4><p>The RAG Stack, or Retrieval-Augmented Generation Stack, is an advanced AI system designed to enhance generative models by integrating information retrieval processes. It combines two core components: retrieval and generation.</p><p><strong>Retrieval:</strong> This component retrieves relevant information from a database or knowledge base based on the input query. Techniques such as keyword matching or semantic search are utilized to identify and fetch the most pertinent documents or data snippets.</p><p><strong>Generation:</strong> This component employs natural language processing models, like GPT (Generative Pre-trained Transformer), to produce coherent and contextually appropriate responses. These models generate text that is informed by the retrieved data, ensuring that the output is both relevant and accurate.</p><h4>How RAG Works:</h4><p>The RAG Stack operates through a multi-step process:</p><ol><li><strong>Input Query:</strong> A user submits a query or prompt that requires a detailed response.</li><li><strong>Retrieval Phase:</strong> The system processes the query to retrieve relevant documents or data points from a knowledge base or external sources.</li><li><strong>Augmentation Phase:</strong> The retrieved information serves as additional context provided to the generation model.</li><li><strong>Generation Phase:</strong> Equipped with the retrieved data, the generation model creates a detailed and informed response.</li></ol><h4>Applications of RAG:</h4><p><strong>Question Answering Systems:</strong> RAG is instrumental in developing sophisticated systems that provide precise answers by leveraging pre-trained models and external knowledge sources. For instance, Facebook’s RAG model can answer complex questions by retrieving relevant documents and generating well-informed responses.</p><p><strong>Chatbots and Virtual Assistants:</strong> RAG enhances conversational agents, enabling them to deliver accurate and context-aware responses in real-time interactions. Customer support virtual assistants utilize RAG to retrieve specific product information or troubleshooting steps and generate tailored, helpful responses.</p><p><strong>Content Generation:</strong> RAG assists in content creation by generating text that incorporates up-to-date information from reliable sources. Content creators can utilize RAG to produce articles, reports, or summaries that are informed and relevant.</p><p>This integration of retrieval and generation capabilities makes the RAG Stack a powerful tool across various applications, enhancing AI systems’ ability to understand and respond effectively to complex queries and tasks.</p><h3>Integrating Knowledge Graphs into the RAG Stack</h3><p>Integrating Knowledge Graphs into the RAG Stack significantly enhances its performance by leveraging structured data relationships. Here’s why this integration is important and the benefits it brings:</p><h4>Why Integration is Important?</h4><p>Integrating Knowledge Graphs into the RAG Stack enhances the system’s ability to provide accurate and contextually relevant information. Knowledge Graphs offer a structured representation of data, capturing complex relationships and entities. This structured data helps improve both the retrieval and generation processes in the RAG Stack.</p><h4>Benefits of Integration:</h4><p><strong>1. Enhanced Retrieval Accuracy:</strong> Knowledge Graphs enable the retrieval component to find more relevant and precise information by leveraging structured relationships between entities. This capability ensures that the system can fetch more accurate data tailored to the user query.</p><p><strong>2. Improved Generation Quality:</strong> By providing the generation model with well-organized and context-rich data, the quality and relevance of generated responses can be significantly improved. This ensures that the output is not only accurate but also contextually appropriate.</p><p><strong>3. Contextual Understanding:</strong> Knowledge Graphs help the RAG Stack to better understand the context of queries. This deeper understanding leads to more accurate and context-aware responses, enhancing the overall user experience.</p><p><strong>4. Better Decision-Making:</strong> The structured data in Knowledge Graphs supports better decision-making by providing a comprehensive view of the information. This holistic perspective enables more informed responses and enhances the system’s ability to support decision-makers.</p><p>Integrating Knowledge Graphs into the RAG Stack thus enhances its capabilities across retrieval, generation, contextual understanding, and decision-making, making it a robust solution for delivering accurate and relevant information in various applications.</p><h3>Implementing the Integration: Step-by- Step Guide</h3><ol><li><strong>Install Necessary Libraries</strong></li></ol><p>Ensure all required libraries are available to create knowledge graphs, perform efficient searches, and generate responses.</p><pre>!pip install networkx faiss-cpu transformers scikit-learn matplotlib</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0NdN-Rs3LFNbTYfKlmA7Ag.png" /></figure><p><strong>2. Create and Visualize a Knowledge Graph</strong></p><p>Use networkx to create and matplotlib to visualize the knowledge graph, including entities and their relationships.</p><p><strong>3.Integrate with a Retrieval System</strong></p><p>Utilize faiss and scikit–learn for efficient retrieval of relevant nodes based on queries.</p><pre>import networkx as nx<br>import matplotlib.pyplot as plt<br><br>kg = nx.DiGraph()<br><br>kg.add_node(&quot;Product_A&quot;, type=&quot;Product&quot;)<br>kg.add_node(&quot;Issue_1&quot;, type=&quot;Issue&quot;)<br>kg.add_node(&quot;Solution_1&quot;, type=&quot;Solution&quot;)<br>kg.add_edge(&quot;Product_A&quot;, &quot;Issue_1&quot;, relation=&quot;has_issue&quot;)<br>kg.add_edge(&quot;Issue_1&quot;, &quot;Solution_1&quot;, relation=&quot;has_solution&quot;)<br><br>pos = nx.spring_layout(kg)<br>plt.figure(figsize=(8, 6))<br>nx.draw(kg, pos, with_labels=True, node_size=3000, node_color=&quot;lightblue&quot;, font_size=10, font_weight=&quot;bold&quot;, arrowsize=20)<br>edge_labels = nx.get_edge_attributes(kg, &#39;relation&#39;)<br>nx.draw_networkx_edge_labels(kg, pos, edge_labels=edge_labels, font_color=&#39;red&#39;)<br>plt.title(&quot;Knowledge Graph&quot;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lueKF92XwENFUG3YWA_PpA.png" /></figure><pre>import faiss<br>from sklearn.feature_extraction.text import TfidfVectorizer<br><br>node_data = {<br>    &quot;Product_A&quot;: &quot;Product A is an advanced technology gadget.&quot;,<br>    &quot;Issue_1&quot;: &quot;Issue 1 involves battery draining quickly.&quot;,<br>    &quot;Solution_1&quot;: &quot;Solution 1 recommends updating the firmware.&quot;<br>}<br><br>vectorizer = TfidfVectorizer()<br>node_texts = [node_data[node] for node in kg.nodes]<br>X = vectorizer.fit_transform(node_texts)<br><br>index = faiss.IndexFlatL2(X.shape[1])<br>index.add(X.toarray())<br><br>def retrieve_nodes(query, top_k=2):<br>    query_vec = vectorizer.transform([query]).toarray()<br>    _, indices = index.search(query_vec, top_k)<br>    return [list(kg.nodes)[i] for i in indices[0]]<br><br>query = &quot;battery issue&quot;<br>retrieved_nodes = retrieve_nodes(query)<br>print(&quot;Retrieved Nodes:&quot;, retrieved_nodes)</pre><p><strong>4.Generate Responses with a Pre-trained Model</strong></p><p>Leverage transformers to use a pre–trained GPT–2 model, adjusting parameters for improved response diversity and quality.</p><pre>from transformers import GPT2Tokenizer, GPT2LMHeadModel<br><br>tokenizer = GPT2Tokenizer.from_pretrained(&quot;gpt2&quot;)<br>model = GPT2LMHeadModel.from_pretrained(&quot;gpt2&quot;)<br><br>tokenizer.pad_token = tokenizer.eos_token<br><br>def generate_response(query):<br>    retrieved_nodes = retrieve_nodes(query)<br>    context = &quot; &quot;.join([node_data[node] for node in retrieved_nodes])<br>    input_text = query + &quot; &quot; + context<br>    inputs = tokenizer.encode_plus(input_text, return_tensors=&quot;pt&quot;, padding=True)<br>    input_ids = inputs[&#39;input_ids&#39;]<br>    attention_mask = inputs[&#39;attention_mask&#39;]<br>    outputs = model.generate(<br>        input_ids,<br>        attention_mask=attention_mask,<br>        max_length=100,<br>        num_return_sequences=1,<br>        no_repeat_ngram_size=2,<br>        pad_token_id=tokenizer.eos_token_id,<br>        temperature=0.7,<br>        top_p=0.9<br>    )<br>    return tokenizer.decode(outputs[0], skip_special_tokens=True)<br><br>query = &quot;How to fix battery issue?&quot;<br>response = generate_response(query)<br>print(&quot;Response:&quot;, response)</pre><p>These steps combine the structure and semantics of knowledge graphs with advanced text generation capabilities to provide accurate and contextual responses.</p><h3>Conclusion</h3><p>Integrating Knowledge Graphs into the RAG Stack significantly enhances the performance and accuracy of AI systems. By leveraging the structured relationships and rich contextual data provided by Knowledge Graphs, the RAG Stack can retrieve more relevant information and generate higher quality responses. This integration not only improves data interlinking and information retrieval but also aids in better decision-making and contextual understanding.</p><p>The step-by-step guide provided demonstrates how to implement this integration effectively, combining the strengths of both Knowledge Graphs and the RAG Stack to achieve superior AI performance. As AI continues to advance, such integrations will be crucial in developing systems that can handle complex queries and provide precise, context-aware information.</p><p>By integrating Knowledge Graphs, AI systems powered by the RAG Stack can excel in various applications, from question answering systems to chatbots and content generation tools. This enhancement marks a significant stride towards creating more intelligent and responsive AI technologies capable of meeting diverse user needs with accuracy and efficiency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7dba1c0749c2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubiai-nlp/integrating-knowledge-graphs-into-the-rag-stack-in-2024-7dba1c0749c2">Integrating Knowledge Graphs into the RAG Stack in 2024</a> was originally published in <a href="https://medium.com/ubiai-nlp">AI Process Automation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LLM reinforcement learning: What is Essential in 2024 ?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/ubiai-nlp/llm-reinforcement-learning-what-is-essential-in-2024-17fec12a7d6a?source=rss----8ee3d32a60e5---4"><img src="https://cdn-images-1.medium.com/max/1284/0*Vnf9NzvQ7Hsb11Cp.png" width="1284"></a></p><p class="medium-feed-snippet">In the swiftly evolving realm of artificial intelligence, Reinforcement Learning (RL) emerges as a cornerstone paradigm, providing a&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/ubiai-nlp/llm-reinforcement-learning-what-is-essential-in-2024-17fec12a7d6a?source=rss----8ee3d32a60e5---4">Continue reading on AI Process Automation »</a></p></div>]]></description>
            <link>https://medium.com/ubiai-nlp/llm-reinforcement-learning-what-is-essential-in-2024-17fec12a7d6a?source=rss----8ee3d32a60e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/17fec12a7d6a</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Walid Amamou]]></dc:creator>
            <pubDate>Wed, 08 May 2024 00:18:18 GMT</pubDate>
            <atom:updated>2024-05-08T00:18:18.069Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A Comparison of Mixture of Experts and Mixture of Tokens for Language Model Efficiency Enhancement]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/ubiai-nlp/a-comparison-of-mixture-of-experts-and-mixture-of-tokens-for-language-model-efficiency-enhancement-2445a086db93?source=rss----8ee3d32a60e5---4"><img src="https://cdn-images-1.medium.com/max/1400/0*pnuMtjCUhTOBjOAm.png" width="1400"></a></p><p class="medium-feed-snippet">In the dynamic realm of large language models, the pursuit of enhanced efficiency and potency takes center stage in innovation. The advent&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/ubiai-nlp/a-comparison-of-mixture-of-experts-and-mixture-of-tokens-for-language-model-efficiency-enhancement-2445a086db93?source=rss----8ee3d32a60e5---4">Continue reading on AI Process Automation »</a></p></div>]]></description>
            <link>https://medium.com/ubiai-nlp/a-comparison-of-mixture-of-experts-and-mixture-of-tokens-for-language-model-efficiency-enhancement-2445a086db93?source=rss----8ee3d32a60e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/2445a086db93</guid>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Walid Amamou]]></dc:creator>
            <pubDate>Wed, 08 May 2024 00:16:59 GMT</pubDate>
            <atom:updated>2024-05-08T00:16:58.947Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[RLHF versus RLAIF: Choosing the Best Approach to Fine-tune Your Large Language Model]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/ubiai-nlp/rlhf-versus-rlaif-choosing-the-best-approach-to-fine-tune-your-large-language-model-08759c139fa8?source=rss----8ee3d32a60e5---4"><img src="https://cdn-images-1.medium.com/max/1400/0*_N04avrvQ3Z1rHHb.png" width="1400"></a></p><p class="medium-feed-snippet">The refinement of large language models (LLMs) emerges as a pivotal area of interest for both researchers and developers. With the&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/ubiai-nlp/rlhf-versus-rlaif-choosing-the-best-approach-to-fine-tune-your-large-language-model-08759c139fa8?source=rss----8ee3d32a60e5---4">Continue reading on AI Process Automation »</a></p></div>]]></description>
            <link>https://medium.com/ubiai-nlp/rlhf-versus-rlaif-choosing-the-best-approach-to-fine-tune-your-large-language-model-08759c139fa8?source=rss----8ee3d32a60e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/08759c139fa8</guid>
            <category><![CDATA[rlhf]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Walid Amamou]]></dc:creator>
            <pubDate>Wed, 08 May 2024 00:15:28 GMT</pubDate>
            <atom:updated>2024-11-12T19:26:13.251Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Fine-Tuning Mistral 7B for Named Entity Recognition (NER)]]></title>
            <link>https://medium.com/ubiai-nlp/fine-tuning-mistral-7b-for-named-entity-recognition-ner-bbb96af918d3?source=rss----8ee3d32a60e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/bbb96af918d3</guid>
            <dc:creator><![CDATA[Walid Amamou]]></dc:creator>
            <pubDate>Thu, 18 Apr 2024 17:36:42 GMT</pubDate>
            <atom:updated>2024-11-12T19:39:34.396Z</atom:updated>
            <content:encoded><![CDATA[<p>In the field of natural language processing (NLP), Named Entity Recognition (NER) is recognized as a crucial task with wide-ranging applications, including information extraction and question-answering systems.</p><p>The introduction of Mistral 7B, an innovative open-source large language model developed by Mistral AI, has brought about a significant transformation in the NLP landscape. This article aims to delve into the capabilities of Mistral 7B for NER tasks, focusing on the process of fine-tuning this advanced model to achieve superior performance in entity recognition.</p><p>In this article, we will cover how to create the training data and fine-tune Mistral 7B using <a href="https://ubiai.tools/fine-tuning/">UbiAI</a>.</p><h3>Introduction to Named Entity Recognition</h3><p>Named Entity Recognition (NER) is a fundamental task in NLP, focused on identifying and categorizing named entities within text, such as person names, locations, organizations, dates, and more. The precise identification of named entities is critical for numerous downstream applications, including information retrieval, sentiment analysis, and knowledge graph construction.</p><p>Traditionally, NER systems relied on manual rule creation and feature engineering techniques, which often lacked scalability and robustness across different domains.</p><p>However, the emergence of deep learning and pretrained language models like Mistral 7B has revolutionized the field. These models offer a data-driven approach that harnesses extensive text data, leading to improved performance and scalability in NER tasks.</p><h3>Forging Ahead: Mistral 7B in Comparison to Other Open Source LLMs</h3><p>Mistral 7B stands out as a leading contender, offering a unique blend of performance, efficiency, and accessibility. Distinguishing itself from its counterparts, Mistral 7B incorporates innovative architectural elements such as grouped-query attention and sliding window attention, elevating both inference speed and sequence handling capabilities.</p><p>These advancements not only differentiate Mistral 7B but also underscore its exceptional adaptability and resilience across a wide array of natural language processing (NLP) tasks. Moreover, Mistral 7B’s Apache 2.0 licensing and community-driven development approach cultivate an atmosphere of collaboration and innovation, cementing its status as a preferred choice among researchers and practitioners seeking state-of-the-art language understanding models.</p><h3>Unveiling Mistral 7B: A Game-Changer in NLP</h3><p>Mistral 7B emerges as an innovative powerhouse in the domain of language models, featuring an impressive 7 billion parameters meticulously crafted to address the intricacies of natural language.</p><p>Engineered with state-of-the-art functionalities like grouped-query attention (GQA) and sliding window attention (SWA), Mistral 7B demonstrates unmatched performance and efficiency, establishing itself as a formidable choice for NLP tasks, including Named Entity Recognition.</p><p>The incorporation of GQA allows Mistral 7B to accelerate inference, enabling real-time processing of textual data — an essential capability for NER tasks operating in dynamic environments. Additionally, SWA empowers Mistral 7B to efficiently handle sequences of varying lengths, ensuring robust performance across a diverse range of text inputs.</p><h3>Fine-Tuning Mistral 7B for NER: Unlocking Its Full Potential</h3><p>Although Mistral 7B exhibits impressive capabilities in its pre-trained state, its full potential is realized through the fine-tuning process. During fine-tuning, the model’s parameters are adjusted to suit the intricacies of particular tasks and datasets. Fine-tuning Mistral 7B for Named Entity Recognition (NER) tasks entails additional training on annotated data, enabling the model to grasp domain-specific patterns and enhance its accuracy in identifying entities.</p><h3>Install the necessary Python packages and libraries required for fine-tuning Mistral</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zQXC2sm0jsB1jVl5.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mcVuFUMsB8KRqJpd.png" /></figure><h3>Data annotation and structure using UBIAI tools</h3><p>In fine-tuning large language models like Mistral 7B, the quality and relevance of the data are critical factors that significantly influence the model’s performance and effectiveness. Utilizing high-quality, well-annotated data ensures that the model learns from accurate and representative examples, thereby improving its ability to generalize and generate reliable outputs.</p><p>For this tutorial, the data is sourced from <a href="https://ubiai.tools/fine-tuning/">UBIAI</a>, a platform known for its robust annotation tools and comprehensive NLP capabilities. Leveraging <a href="https://ubiai.tools/fine-tuning/">UBIAI’</a>s annotation capabilities ensures that the data used for fine-tuning is meticulously labeled and tailored to the specific task at hand, maximizing the effectiveness of the training process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rLrRr8CKsl1nLK-0.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9FLX_zhNY5kaTIpD.png" /></figure><p>This code reads JSON data from a file containing invoice information. It organizes the data into a structured format, ensuring there are no duplicate annotations. The processed results are stored for further analysis and fine-tuning Mistral for Named Entity Recognition (NER) tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GTKbGTjulStozEBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1ZTi_4xl80XdTOQO.png" /></figure><p>1371</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_Bq67NnGOx4hfDZ_.png" /></figure><p>Distinct Labels: {‘PERSON’, ‘PRODUCT’, ‘FACILITY’, ‘MONEY’, ‘EVENT’, ‘DATE’, ‘ORGANIZATION’, ‘LOCATION’}</p><p>The dataset comprises documents containing names, texts, and annotations. These annotations encompass various entities like persons, organizations, locations, facilities, events, among others, offering structured data for Named Entity Recognition (NER) tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-FMP-U5Czmw0rxJ1.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xJeew4piKUJgMN6h.png" /></figure><p>The dataset is now augmented with a comprehensive prompt delineating instructions for entity extraction tasks. Each instruction delineates precise guidelines for extracting entities across various labels, including DATE, PERSON, ORGANIZATION, LOCATION, FACILITY, EVENT, MONEY, and PRODUCT. The prompt underscores the importance of accuracy and relevance in responses, offering guidelines to ensure consistency and comprehensiveness in the extracted information.</p><p>This structured prompt facilitates streamlined processing of the data for entity recognition tasks, aligning seamlessly with the objectives of the NER (Named Entity Recognition) process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ObxxYQW1WR4uLAW4.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kNoFNOFvPKwtQZ4i.png" /></figure><p>This process involves converting a subset of data into string representations, appending them to a list, and saving them to a CSV file. Subsequently, the CSV file is read into a Pandas DataFrame and transformed into a Hugging Face Datasets object for further processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I-ZDeU1XkhjQC2ze.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZCZfcpSHzhoCRl8y.png" /></figure><p>the Mistral 7B base model is loaded using the BitsAndBytesConfig configuration, which enables quantization for efficient memory usage and faster inference. Additionally, the tokenizer associated with Mistral 7B is loaded, ensuring proper padding and end-of-sequence token settings for text processing tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f4Uw4hy83buqrxGM.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eAzLJun6X_cdaFIK.png" /></figure><p>This section of the code sets up monitoring for the fine-tuning process of Mistral 7B using the Weights &amp; Biases (W&amp;B) platform. By authenticating with W&amp;B using the provided API key, the training progress and performance metrics are continuously monitored in real-time. The `wandb.init()` function initiates a new run within the designated project (“Fine-tuning Mistral 7B UBIAI”), with the job type specified as “training”. Enabling anonymous access ensures the security of the training data while facilitating collaborative monitoring and analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qmu1SzE7IZf5vEjK.png" /></figure><p>initializing hyperparameters for the training process, defining settings such as output directory, number of epochs, batch size, learning rate, and logging frequency. Additionally, it configures the SFTTrainer, specifying the model, dataset, tokenizer, and other relevant parameters essential for fine-tuning Mistral 7B for the given task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jG5BIZ5-UoV8YADF.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_pmr8fagr0vfVDFG.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TDpam3h51VPDnF2i.png" /></figure><h3>Let’s Try Our Model: Testing Mistral 7B with User Prompts</h3><p>The provided function stream takes a user prompt as input and generates text based on that prompt using the <a href="https://ubiai.tools/mistral-ai-introduces-mixtral-8x7b-a-revolutionary-ai-model">Mistral</a> 7B model. It utilizes the model’s generate method to produce text, using the user’s prompt as context. The generated text is then returned as output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2cDfQFsY_a4MpygA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mFigaXX7hm8zWEQm.png" /></figure><p>Response:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fs5vHOKE5QQA-ChJ.png" /></figure><h3>Conclusion</h3><p><a href="https://ubiai.tools/fine-tuning-mistral-for-ner/">Fine-tuning Mistral 7B</a> for Named Entity Recognition represents a transformative approach to entity recognition tasks, offering enhanced performance, adaptability, and efficiency. As organizations continue to leverage NER for information extraction, knowledge discovery, and beyond, the capabilities unlocked by Mistral 7B pave the way for groundbreaking advancements in NLP. By harnessing the power of Mistral 7B and fine-tuning it for NER, practitioners can unlock new possibilities in understanding and processing textual data, driving innovation across diverse domains.</p><p>Credits of this article goes to: <a href="https://medium.com/u/14c24afdd987">Ilyes Ben Khalifa</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbb96af918d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubiai-nlp/fine-tuning-mistral-7b-for-named-entity-recognition-ner-bbb96af918d3">Fine-Tuning Mistral 7B for Named Entity Recognition (NER)</a> was originally published in <a href="https://medium.com/ubiai-nlp">AI Process Automation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Vector Similarity Search Functions]]></title>
            <link>https://medium.com/ubiai-nlp/how-vector-similarity-search-functions-d7f667b8c5bf?source=rss----8ee3d32a60e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/d7f667b8c5bf</guid>
            <dc:creator><![CDATA[Walid Amamou]]></dc:creator>
            <pubDate>Thu, 18 Apr 2024 13:30:30 GMT</pubDate>
            <atom:updated>2024-04-18T13:30:30.430Z</atom:updated>
            <content:encoded><![CDATA[<p>In the contemporary era dominated by data, comprehending the intricacies of navigating and analyzing vast information landscapes is crucial. Vector similarity search emerges as a key player in this endeavor, converting raw data into actionable insights across diverse domains. This method, grounded in the mathematical principles of vector spaces, empowers us to explore high-dimensional datasets with precision and efficiency, a notable departure from conventional text-based search methods.</p><p>By assessing data points for proximity or similarity, it reveals hidden patterns and connections, facilitating advancements in fields ranging from machine learning to personalized recommendations. Exploring the mechanics and implications of similarity search unveils the essence of data-driven decision-making, underscoring its pivotal role in shaping the future trajectory of technology and innovation.</p><h3>Understanding Vectors in Data Representation</h3><p>Data points are depicted as vectors within a multidimensional space, significantly influencing the process of conducting similarity searches. Let’s delve deeper into the mechanics:</p><p>Vector Representation: In the realm of data science, a vector is an organized sequence of numbers, with each number representing a specific dimension or feature of the data. For example, for a 3-dimensional vector, it can be denoted as ⃗v = (v1, v2, v3).</p><p>High-Dimensional Space: These spaces encompass a large number of dimensions, allowing for the capture of intricate relationships between data points, which is essential for modern data analysis.</p><p>Examples:<br>- Text Data: Using the Bag of Words model, a text such as “cat on the mat” with a vocabulary of {cat, mat, on, the} can be represented as a text vector ⃗ = (1, 1, 1, 1).<br>- Image Data: For instance, a grayscale image measuring 2x2 can be depicted as an image vector ⃗ = (p1, p2, p3, p4), where each pi represents the intensity of the corresponding pixel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F3J2efw2B0f65mPY1fxfxA.png" /></figure><h3>From Text to Images: Applying Similarity Search Across Domains</h3><p>Similarity search techniques play a crucial role in various domains, facilitating intricate analysis and retrieval tasks. Here’s an exploration of its diverse applications:</p><p>Text Analysis: In the realm of natural language processing (NLP), similarity search serves as a foundation for functions like detecting semantic similarities between documents. It aids in tasks such as plagiarism detection, content recommendation, and question-answering systems. For instance, vector space models translate textual content into numerical vectors, enabling the application of similarity metrics to identify closely related documents.</p><p>Image Retrieval: Similarity search is pivotal in image retrieval systems, allowing users to find images visually similar to a query image. This application finds widespread use in digital libraries, e-commerce platforms for product searches, and social media. Techniques like convolutional neural networks (CNNs) generate feature vectors for images, streamlining the retrieval process based on visual similarities.</p><p>Music and Audio Retrieval: Similarity search extends to the realm of audio, where algorithms analyze spectral features of music or sounds to recommend similar tracks or identify songs from fragments. Music streaming services leverage this technology to curate personalized playlists based on users’ listening preferences.</p><p>Bioinformatics: In bioinformatics, similarity search is instrumental in comparing genetic sequences, aiding in the identification of genes with analogous functions across diverse organisms. This comparison is crucial for elucidating evolutionary relationships and uncovering new genes.</p><p>These examples underscore the versatility and practicality of similarity search techniques, emphasizing their significance across a spectrum of disciplines.</p><h3>Technologies and Tools for Vector Similarity Search</h3><h3>FAISS: Fast Library for Approximate Nearest Neigh bors</h3><p>Overview: Tailored for clustering and similarity searches of dense vectors, particularly adept at handling large datasets through quantization and GPU acceleration.</p><p>Benefits: Offers notable enhancements in both speed and accuracy, particularly advantageous for large-scale image and video retrieval tasks.</p><p>Typical Use Cases: Ideal for searching within expansive image databases or extensive video libraries. For instance, a social media platform may leverage FAISS for swiftly locating visually akin user-uploaded photos.</p><h3>Annoy: Approximate Nearest Neighbors Oh Yeah</h3><p>Features: Facilitates memory-efficient searches utilizing static file-based indexes, ensuring ease of sharing indexes across systems.</p><p>When to Use It: Most suitable for scenarios demanding memory efficiency and dealing with static datasets. For example, a music recommendation system where the song vector index remains relatively stable and requires efficient distribution across platforms.</p><h3>Elasticsearch: Scalable Search and Analytics Engine</h3><p>How It Supports Vector Similarity Search: Employs “dense vector fields” to facilitate semantically relevant searches by comparing document embeddings.</p><p>Applications in Search Engines: Enhances the ability to retrieve conceptually similar results, even when users input different keywords. For instance, an online retailer can enhance the search experience by matching product descriptions more accurately with user queries.</p><h3>Comparative Analysis</h3><p>Performance: FAISS excels in large-scale searches, particularly with GPU support. Annoy is optimized for smaller, memory-sensitive environments. Elasticsearch, while versatile, may not match FAISS’s performance for handling large datasets.</p><p>Ease of Use: Elasticsearch is renowned for its user-friendly interface. Both Annoy and FAISS provide robust Python bindings but demand specialized expertise for effective utilization.</p><p>Scalability: FAISS scales efficiently with GPU resources, making it suitable for handling massive datasets. Elasticsearch is well-suited for distributed environments requiring horizontal scalability.</p><h3>Algorithms for Vector Similarity Search</h3><h3>Brute Force Search</h3><p>Overview: Entails comparing the query vector against every other vector in the dataset to identify the closest match.</p><p>Limitations:<br>- Scalability issues arise as the dataset expands, resulting in impractical computation times for large datasets.<br>- Incurs high computational costs when data structure or indexing strategies are not employed.</p><p>Example: Searching for a particular face within a database of millions entails comparing the query face against each entry in the database.</p><h3>Approximate Nearest Neighbors</h3><p>Explanation: The goal of approximate nearest neighbor (ANN) search is to find the closest neighbors “approximately” rather than precisely, sacrificing a small amount of accuracy in exchange for substantial speed gains.</p><p>Necessity for Scalability:<br>- The enhanced speed and reduced computational power and memory demands of ANN make it well-suited for real-time applications and handling large datasets.</p><p>Example: Spotify employs Annoy for music recommendations, where an exact match is not imperative, but swift performance and reasonable accuracy are vital.</p><h3>Popular Algorithms</h3><p>K-Nearest Neighbors (K-NN): Identifies the ‘k’ vectors closest to the query vector. Often employed in systems such as movie recommendations by comparing user preferences.</p><p>Locality-Sensitive Hashing (LSH): Groups vectors into “buckets” based on their similarity, thereby reducing the search space. Commonly utilized in image search applications to retrieve visually similar images by restricting comparisons to images within the same bucket.</p><p>Tree-Based Methods:<br>- KD-Trees: Divides data into a k-dimensional space, offering efficiency particularly in low-dimensional scenarios such as geographic location searches.<br>- Ball Trees: Organizes data within nested “balls,” making it suitable for high-dimensional spaces like feature vectors derived from images.</p><h3>Choosing the Right Algorithm</h3><p>The selection of the appropriate algorithm depends on factors such as dataset size, dimensionality, and whether processing is conducted in real-time or batch mode.</p><p>Dataset Size: Larger datasets typically benefit from approximate nearest neighbor (ANN) or locality-sensitive hashing (LSH) methods, while smaller datasets may suffice with brute-force or KD-trees approaches.</p><p>Dimensionality: High-dimensional data often necessitate algorithms like Ball trees or ANN methods to address the challenges posed by the curse of dimensionality.</p><p>Real-time vs. Batch Processing: Real-time applications prioritize faster, approximate methods like ANN, whereas batch processes can accommodate more accurate algorithms.</p><h3>Similarity Metrics: The Backbone of Vector Search</h3><p>Similarity metrics are integral to vector search, facilitating comparisons of high-dimensional data vectors. Let’s delve into some of the most significant metrics:</p><p>Cosine Similarity:<br>Cosine similarity assesses the cosine of the angle between two vectors. It evaluates the orientation rather than the magnitude of vectors in space, making it especially beneficial for text analysis. The formula is:<br>\[ \text{Cosine Similarity}(\vec{a}, \vec{b}) = \frac{\vec{a} \cdot \vec{b}}{\|\vec{a}\| \|\vec{b}\|} \]<br>where \( \vec{a} \cdot \vec{b} \) is the dot product of vectors \( \vec{a} \) and \( \vec{b} \), and \( \|\vec{a}\| \) and \( \|\vec{b}\| \) are the magnitudes of the vectors.</p><p>Euclidean Distance:<br>Euclidean distance, also known as the L2 norm, measures the “straight line” distance between two points in Euclidean space. It finds wide application in clustering and classification tasks. The formula for the Euclidean distance between two points \( \vec{a} \) and \( \vec{b} \) in space is:<br>\[ \text{Euclidean Distance}(\vec{a}, \vec{b}) = \sqrt{\sum_{i=1}^{n} (a_i — b_i)²} \]<br>where \( n \) is the number of dimensions of the vectors, and \( a_i \) and \( b_i \) are the components of \( \vec{a} \) and \( \vec{b} \) respectively.</p><p>These metrics play a vital role in similarity search, impacting the performance and suitability of various applications.</p><h3>Practical Applications of Vector Similarity Search</h3><p>Image Retrieval</p><p>How It Powers Image Search Engines:<br>- Converts images into high-dimensional vectors that represent unique features such as color, texture, and shape.<br>- Searches for images with vectors most similar to the query image, effectively retrieving images with similar content.</p><p>Examples:<br>- Google Photos: Utilizes vector similarity to search through photo libraries for specific objects, people, or scenes without requiring manual tagging.<br>- Stock Photo Services: Platforms like Shutterstock enable users to upload images to find visually similar stock photos, assisting designers and content creators.</p><p>Recommendation Systems</p><p>Role in Enhancing User Experience:<br>- Analyzes user behavior and item characteristics, converting them into vectors.<br>- Identifies items closest to a user’s preferences through vector similarity search, offering personalized recommendations.</p><p>Examples:<br>- Spotify: Generates music recommendation playlists by comparing the musical features of songs with a user’s listening history.<br>- E-commerce Platforms: Amazon recommends products by comparing user browsing and purchase history vectors with product catalogs, thereby enhancing shopping experiences.</p><h3>Using UBIAi to Enhance Vector Similarity Search</h3><p>UBIAi stands out as a crucial tool in the domain of vector similarity search, streamlining the creation and refinement of annotated datasets pivotal for training effective machine learning models driving these searches.</p><p>Precision in Data Annotation:<br>UBIAi offers an intuitive text annotation interface, simplifying the complexities associated with labeling large datasets. This ensures accurate annotation, crucial for developing vector representations that capture information nuances, thus enhancing similarity search algorithms’ effectiveness.</p><p>Multilingual Support for Global Applications:<br>UBIAi’s comprehensive multilingual text annotation support facilitates the development of linguistically inclusive and culturally aware models. This expands the reach and applicability of similarity search solutions, crucial in the global digital landscape.</p><p>Enhancing Search in OCR-Extracted Text:<br>UBIAi’s OCR annotation capabilities extend vector similarity search beyond digital text to include scanned documents and images. Particularly beneficial for industries relying on non-digital documents like legal and historical research, it enables more precise retrieval based on vector similarity.</p><p>Accelerated Model Development with Auto-Labeling:<br>UBIAi’s auto-labeling and pre-annotation features expedite similarity search model development. By automating initial data labeling stages, researchers and developers can focus on refining models, accelerating the process from concept to deployment.</p><p><strong>Collaborative Dataset Creation:<br></strong>UBIAi’s collaborative platform fosters team-based dataset creation and model training, speeding up dataset preparation and ensuring diverse annotation approaches. This results in more robust similarity search models.</p><p>By leveraging UBIAi’s capabilities, organizations can significantly improve the efficiency and accuracy of their vector similarity search systems. Its prowess in facilitating high-quality data annotation, supporting multilingual datasets, enabling efficient OCR-based searches, and expediting model development makes it indispensable in enhancing search and retrieval operations across various domains.</p><p>Through UBIAi, the pathway to developing advanced, inclusive, and efficient search and retrieval operations becomes clearer, highlighting AI tools’ transformative potential in optimizing operations across diverse domains.</p><h3>Challenges and Future Directions in Vector Similarity Search</h3><p>Scalability</p><p>Challenge: The challenge lies in scaling vector search to handle massive datasets without compromising performance or accuracy.</p><p>Strategies:<br>- Distributed Computing: Utilize cloud-based platforms to parallelize search processes, enabling efficient handling of large-scale datasets.<br>- Index Partitioning: Divide the search index into smaller segments for concurrent searching, facilitating scalability while maintaining performance.</p><p>Accuracy vs. Speed Trade-off</p><p>Challenge: Balancing quick response times for queries with the need for accurate search outcomes poses a significant challenge.</p><p>Approaches:<br>- Hybrid Models: Employ a combination of exact and approximate search methods tailored to the application’s requirements, prioritizing speed without sacrificing accuracy.<br>- Dynamic Algorithm Selection: Dynamically choose the search algorithm based on query complexity and dataset characteristics to optimize both speed and accuracy.</p><p>Emerging Technologies</p><p>Quantum Computing: Quantum computing holds the promise of revolutionizing vector similarity search by enabling extremely fast information processing, facilitating almost instantaneous searches across massive datasets.</p><p>AI and Machine Learning Enhancements: Advances in AI models enhance data understanding and categorization, empowering future algorithms to deliver more context-aware search capabilities.</p><p>Neural Hashing: Research into neural network-based hashing aims to achieve more efficient and precise encoding and retrieval of high-dimensional data vectors, potentially enhancing scalability and accuracy in vector similarity search.</p><h3>Conclusion</h3><p>In summary, vector similarity search represents a groundbreaking innovation in our capacity to navigate and interpret the vast, multidimensional data landscapes of the digital era. By delving into mathematical models for precise and efficient data retrieval, this technique has revolutionized various fields, spanning from personalized recommendations to bioinformatics. Through examining technologies like FAISS, Annoy, and Elasticsearch, alongside the foundational significance of similarity metrics such as cosine similarity and Euclidean distance, we’ve underscored the critical importance and dynamic nature of vector similarity search.</p><p>Despite encountering challenges related to scalability, accuracy, and speed, the future of vector similarity search is promising, driven by advancements in quantum computing, AI, and machine learning. These emerging technologies offer the potential to overcome current limitations, delivering more advanced search capabilities. Ultimately, vector similarity search serves as a testament to the potency of data-driven insights, heralding a future where our ability to sift through and interpret information knows no bounds.</p><p>Embrace the future of vector similarity search and contribute to shaping its evolution. Whether you’re involved in research, development, or simply passionate about technology, your participation can yield a significant impact. Explore, innovate, and collaborate to unlock new frontiers in data analysis and retrieval. The field awaits breakthroughs — let’s forge them together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7f667b8c5bf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubiai-nlp/how-vector-similarity-search-functions-d7f667b8c5bf">How Vector Similarity Search Functions</a> was originally published in <a href="https://medium.com/ubiai-nlp">AI Process Automation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Annotate PDFs and Scanned Images for NLP Applications using UBIAI Text Annotation Tool]]></title>
            <link>https://medium.com/ubiai-nlp/how-to-annotate-pdfs-and-scanned-images-for-nlp-applications-using-ubiai-text-annotation-tool-c69ecb843e6d?source=rss----8ee3d32a60e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/c69ecb843e6d</guid>
            <dc:creator><![CDATA[Wiem Souai]]></dc:creator>
            <pubDate>Mon, 08 Apr 2024 14:43:58 GMT</pubDate>
            <atom:updated>2024-04-08T14:43:58.645Z</atom:updated>
            <content:encoded><![CDATA[<p>Automating the retrieval of information from various documents like receipts, contracts, and invoices is pivotal for enhancing business efficiency and productivity while cutting costs. However, this transformative capability heavily relies on text annotation. While natural language processing (NLP) techniques such as Named Entity Recognition (NER) or relation extraction have been effectively utilized for information retrieval in unstructured text, deciphering structured documents like invoices, receipts, and contracts presents a more intricate challenge.</p><p>Primarily, the entities we aim to extract (e.g., price, seller, tax) lack substantial semantic context that could train an NLP model effectively. Moreover, the layout of documents often varies significantly from one instance to another, rendering traditional NLP tasks like NER less effective on structured documents. Nevertheless, structured texts, such as invoices, inherently contain valuable spatial information regarding the entities they encapsulate. Leveraging this spatial information enables the creation of a 2-D position embedding, signifying the relative position of tokens within a document.</p><p>Recently, Microsoft introduced LayoutLM, a groundbreaking model designed to simultaneously capture interactions between text and layout information within scanned document images. This innovative approach has yielded remarkable advancements in various downstream tasks, notably enhancing form understanding, receipt comprehension, and document image classification. For instance, LayoutLM has elevated performance metrics across the board, from form understanding (increasing from 70.72 to 79.27) to receipt understanding (rising from 94.02 to 95.24), and even document image classification (improving from 93.07 to 94.42), establishing new benchmarks in these domains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t6dZbF_qnoIq7KwxmmABpw.png" /></figure><h3>Scanned Images and PDF annotation</h3><p>To fine-tune the LayoutLM model for custom invoices, annotated data containing the bounding box coordinates of each token and their linking is necessary. This annotated data ensures that the model learns to understand the layout and content of the invoices accurately. However, finding an annotation tool that seamlessly integrates OCR parsing and annotation directly on native PDFs and images can be challenging. Many existing annotation tools either come with a high price tag or lack comprehensive OCR support, necessitating an external OCR step before annotation.</p><p>At UBIAI, we’ve developed an end-to-end solution to address this gap. Our platform enables direct annotation on native PDFs, scanned images, or images from your device without compromising on the integrity of document layout information. This capability is particularly advantageous for invoice extraction, where both text sequence and spatial information are crucial for accurate understanding.</p><p>Here’s how it works: Simply upload your PDF, JPG, or PNG files directly to our platform and commence annotation. Leveraging cutting-edge OCR technology from AWS Textract, UBIAI swiftly parses your document, extracting all tokens along with their respective bounding boxes. From there, annotators can effortlessly highlight tokens either on the original document (displayed in the right panel) or the parsed text (shown in the left panel) and assign appropriate labels.</p><p>In addition to entity labeling, our platform supports relations annotation and text classification labeling, offering a comprehensive toolkit for fine-tuning the LayoutLM model to suit your specific needs. With UBIAI, annotating invoices becomes a streamlined and efficient process, ensuring optimal model performance and accurate extraction of crucial information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fOgjBewL5nRWImGuy_K8KQ.png" /></figure><h3>Invoice Pre-annotation</h3><p>In addition, you can pre-annotate your invoices using dictionaries, regular expressions (for example to find dates, emails, names, etc.) or a pre-trained ML model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*epTGyxag1kI0S7TzOrbx5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QOuMbt4BQylNsz9FBmzvPg.png" /></figure><h3>Annotation Export</h3><p>Once you finish the annotation, simply export the annotated documents in JSON format:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IJUgpM13AxNx1h0LqlShbg.png" /></figure><h3>Conclusion</h3><p>UBIAI’s OCR annotation feature streamlines the process of training NLP models by offering a user-friendly and precise labeling interface. Gone are the days of grappling with pre-processing your images using external APIs or establishing rules for pre-annotating your documents. With UBIAI, the workflow is straightforward: upload your documents, annotate them with ease, and export the annotated data effortlessly.</p><p>By eliminating the need for complex pre-processing steps and manual rule creation, UBIAI significantly reduces friction in the model training process. This means you can focus more on refining your annotations and improving model performance, rather than getting bogged down in tedious preparatory tasks.</p><p>With our intuitive interface and accurate OCR capabilities, annotating documents becomes a seamless experience. Whether you’re working with native PDFs, scanned images, or photos from your device, UBIAI’s OCR annotation feature ensures that you can annotate with precision and efficiency.</p><p>Once your documents are annotated to your satisfaction, exporting the data is a breeze. UBIAI empowers you to seamlessly integrate annotated data into your NLP pipeline, allowing you to train models with confidence and achieve optimal results.</p><p>With UBIAI’s OCR annotation, training NLP models has never been easier. Say goodbye to cumbersome pre-processing and hello to a streamlined, friction-free annotation process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c69ecb843e6d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubiai-nlp/how-to-annotate-pdfs-and-scanned-images-for-nlp-applications-using-ubiai-text-annotation-tool-c69ecb843e6d">How to Annotate PDFs and Scanned Images for NLP Applications using UBIAI Text Annotation Tool</a> was originally published in <a href="https://medium.com/ubiai-nlp">AI Process Automation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Named Entity Recognition with BERT]]></title>
            <link>https://medium.com/ubiai-nlp/mastering-named-entity-recognition-with-bert-ca8d04b67b18?source=rss----8ee3d32a60e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/ca8d04b67b18</guid>
            <dc:creator><![CDATA[Wiem Souai]]></dc:creator>
            <pubDate>Fri, 05 Apr 2024 15:46:40 GMT</pubDate>
            <atom:updated>2024-04-05T15:46:40.377Z</atom:updated>
            <content:encoded><![CDATA[<p>In the expansive realm of language comprehension, one critical task stands out — Named Entity Recognition (NER). This process involves training machines to identify vital elements in text, such as names of individuals, locations, and organizations.</p><p>Now, let’s envision a scenario where machines not only grasp individual words in a sentence but also comprehend the context in which these words are situated. This transformative capability is precisely where BERT (Bidirectional Encoder Representations from Transformers) takes the spotlight, revolutionizing the landscape.</p><p>Our objective here is straightforward: to delve into the intricacies of NER and unveil the mastery achievable with BERT. It’s not merely about recognizing entities; it’s about doing so with a deep understanding of context — an achievement that traditional NER methods have struggled to accomplish.</p><p>So, what lies ahead? We’re delving into the core architecture of BERT, exploring how to fine-tune it for NER tasks, and uncovering the tangible benefits it offers to natural language processing. This journey isn’t an abstract pursuit; it’s a practical roadmap for harnessing BERT’s capabilities for real-world applications in Named Entity Recognition.</p><p>Intrigued? This isn’t just an academic endeavor; it’s an exploration into the mastery of Named Entity Recognition with BERT. We’re aiming for a level of understanding where words transcend their surface meanings, and the depth of comprehension reaches unprecedented levels. Are you ready to embark on this journey? Let’s begin.</p><h3>What is BERT?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lkgCkomXufoln6hUODnNUg.png" /></figure><p>BERT, short for Bidirectional Encoder Representations from Transformers, stands as a groundbreaking model in natural language processing (NLP). Its fundamental design allows it to comprehend and process language bidirectionally, considering both the left and right context of each word in a sentence.</p><p>Traditionally, language models processed text unidirectionally, either from left to right or right to left. However, BERT revolutionized this approach by introducing bidirectional context understanding. This means that when BERT analyzes a word, it not only considers the preceding words but also the succeeding ones in a sentence. This bidirectional methodology enables BERT to capture a more comprehensive and nuanced understanding of word context.</p><p>The revolutionary impact of BERT lies in its capability to grasp the intricacies of language, surpassing mere word-to-word relationships. By considering the complete context of a word within a sentence, BERT excels at capturing the subtleties, nuances, and dependencies vital for a more precise language understanding.</p><p>BERT undergoes a pre-training process where it is exposed to extensive text data and trained to predict missing words within sentences in an unsupervised manner. This pre-training phase equips BERT with a robust understanding of language structures and relationships. Subsequently, BERT can be fine-tuned for specific tasks, such as Named Entity Recognition (NER), enhancing its effectiveness in diverse NLP applications.</p><p>In essence, BERT’s ability to capture bidirectional context during pre-training empowers it to address a wide array of NLP tasks with a depth of understanding previously unattainable. This bidirectional approach positions BERT as a transformative force in the domain of natural language comprehension.</p><h3>Why BERT for Named Entity Recognition?</h3><p>Limitations of Traditional Methods:</p><p>Traditional Named Entity Recognition (NER) methods often struggled with capturing the intricate context and nuances present in natural language. These approaches typically relied on handcrafted features and lacked the ability to consider bidirectional relationships between words in a sentence. Consequently, they fell short when confronted with the complexity of language, particularly in scenarios where the meaning of an entity is deeply tied to its surrounding context.</p><p>BERT’s Bidirectional Context Representation:</p><p>Enter BERT, with its bidirectional context representation, addressing the limitations of traditional NER approaches. By considering both the left and right context of each word in a sentence, BERT excels at understanding the dependencies between words, making it particularly adept at capturing the context in which named entities appear. This bidirectional approach allows BERT to discern subtle nuances and relationships, empowering it to recognize entities with a level of accuracy and depth that traditional methods could not achieve.</p><p>Examples of BERT’s Success in NLP:</p><p>BERT’s success extends beyond just NER, and its performance in various NLP applications reinforces its suitability for NER tasks. In question-answering tasks, BERT has demonstrated a keen understanding of context, enabling it to provide more accurate and contextually relevant answers. In sentiment analysis, BERT’s bidirectional context understanding proves valuable in grasping the sentiment expressed in a piece of text with greater accuracy. Moreover, in machine translation, BERT’s ability to capture bidirectional context aids in producing more contextually coherent translations. These successes across diverse NLP applications underscore BERT’s versatility and highlight its potential to significantly enhance NER by providing a contextual understanding that is essential for accurately identifying named entities in different contexts.</p><p>In essence, BERT’s bidirectional context representation emerges as a powerful solution to the limitations of traditional NER methods, opening up new possibilities for accurate and context-aware entity recognition in natural language text.</p><h3>BERT Architecture:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5-k-WCXeu4r2TkOH0Us57Q.png" /></figure><p>At the core of BERT’s transformative abilities lies its sophisticated architecture, which leverages attention mechanisms and transformers, reshaping how machines comprehend language.</p><p>Attention Mechanisms and Transformers:<br>BERT’s architecture builds upon attention mechanisms, a pivotal innovation in natural language processing. These mechanisms enable the model to concentrate on different segments of the input sequence, assigning varying levels of significance to each element. This capability proves potent in capturing long-range dependencies within text, allowing BERT to discern intricate relationships between words.<br>Transformers, serving as the architectural framework of BERT, manage input data in parallel, facilitating efficient training and inference. These self-attention transformers empower BERT to consider the entire context of a word, encompassing both its preceding and subsequent elements. This bidirectional processing marks a departure from conventional models, enabling BERT to capture the richness of language context comprehensively.</p><p>Bidirectional Context Understanding:<br>What distinguishes BERT is its bidirectional approach to context comprehension. Unlike previous models that processed language unidirectionally, BERT simultaneously considers both directions. When analyzing a word, BERT not only examines the preceding words but also those following it in the sentence. This bidirectional comprehension enables BERT to capture language intricacies, ensuring a more precise context representation.<br>In essence, the fusion of attention mechanisms and transformers, alongside BERT’s bidirectional architecture, equips the model with a holistic grasp of language context. This capability proves pivotal in tasks like Named Entity Recognition (NER), where comprehending the complete context is crucial for accurately identifying and categorizing entities in natural language text. As we delve deeper into BERT’s NER applications, this bidirectional contextual understanding emerges as a pivotal factor in its unparalleled success.</p><h3>Fine-Tuning BERT for NER:</h3><p>Fine-tuning BERT for Named Entity Recognition (NER) involves adapting the pre-trained BERT model to the specifics of an NER task. This process allows BERT to leverage its pre-trained contextual understanding for the specialized task of identifying named entities in a given domain.</p><p>Here’s a simplified outline of the steps involved in fine-tuning BERT for NER using the popular Hugging Face Transformers library in Python:</p><ol><li>Import necessary libraries, including Transformers for BERT-based models, PyTorch for neural network operations, and tqdm for progress tracking.</li><li>Set up a BERT tokenizer and a token classification model, specifying the number of output labels corresponding to predefined entity types.</li><li>Tokenize and format the sample data for Named Entity Recognition (NER), converting text into tokenized input IDs and label IDs for fine-tuning.</li><li>Train the model using the AdamW optimizer with a specified learning rate and a defined batch size.</li><li>Save the fine-tuned model for later use.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*woABsV-8WD4OCVMx6RnBXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*foGh0tf5Ga8Kfelf1_gRVQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E3hsGAuQgeEwVCLwNt5w9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_fyCsGMHi5wje3ewQR73sQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fp4N4L9WnlZjwIkhi3Sdzg.png" /></figure><p>The effectiveness of fine-tuning BERT for Named Entity Recognition (NER) is significantly dependent on the availability of high-quality annotated datasets. Annotated datasets contain text samples accompanied by labeled entities, enabling the model to grasp the correlations between words and entity types. The richness and diversity of the annotated dataset directly influence the model’s ability to generalize well to unfamiliar data instances. Therefore, comprehensive and representative annotated datasets play a crucial role in enhancing the performance and accuracy of BERT-based NER models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kVlQ6bcrQNpSEcid2xCXvg.png" /></figure><h3>Challenges in Fine-Tuning and Solutions:</h3><p>In scenarios where annotated datasets are limited in size, the model’s ability to generalize effectively may be compromised. A viable solution is to augment the dataset through techniques such as data synthesis or leveraging pre-trained embeddings to enrich the available data.</p><p>Additionally, class imbalances within the dataset, where certain entity types are disproportionately represented, can introduce biases into the model. To mitigate this issue, techniques like class weighting or oversampling can be employed to ensure a more balanced representation of different entity types.</p><p>Hyperparameter tuning is another critical aspect of fine-tuning BERT for Named Entity Recognition. Selecting appropriate values for parameters such as learning rate, batch size, and number of training epochs significantly impacts the model’s performance. Conducting systematic experiments to optimize these hyperparameters for the specific NER task at hand is essential.</p><p>By navigating through the fine-tuning process while paying close attention to data quality and addressing common challenges like limited annotated data and class imbalances, BERT can be tailored to excel in the complexities of Named Entity Recognition tasks.</p><h3>Benefits of Using bert-base-NER for NER:</h3><p>The bert-base-NER model, available within Hugging Face’s Transformers library, demonstrates a significant improvement in accuracy and overall performance for Named Entity Recognition (NER). By harnessing the bidirectional context understanding of BERT, this model excels at capturing subtle language nuances, resulting in more precise identification and classification of named entities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YBN1Qvd_6FTTMe851Wfplw.png" /></figure><p>The bert-base-NER model adeptly tackles challenges presented by ambiguous entities and complex sentence structures. Its bidirectional architecture enables it to navigate through intricate language constructs, facilitating accurate predictions even in situations where entity meanings hinge heavily on broader contextual cues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IZLEZNW5hiq14Rowcs_DZg.png" /></figure><p>This code snippet showcases the tokenization of medical text using a BERT tokenizer and subsequent inference with a pre-trained BERT-based token classification model (‘bert-base-NER’). The predicted labels are then associated back to entity names using the tokenizer, and the identified medical entities are printed for analysis or utilization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dnt0MEEE62FOd7PQS-4zbQ.png" /></figure><p>In legal documents, the model demonstrates its capability to discern entities such as “plaintiff” and “defendant” with contextual comprehension, highlighting its utility in extracting pertinent information from legal text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*50tcrLn3tHnJJYCndqg6Jw.png" /></figure><p>In the financial news domain, the model showcases its proficiency by accurately identifying entities such as “stock market” and “corporate earnings,” underscoring its ability to parse and extract relevant information from financial documents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AeyRySf3sTBXGkZSWv2C-A.png" /></figure><h3>Challenges and Future Directions:</h3><p>This example highlights how the bert-base-NER model can effectively extract relevant named entities from financial text, including entities such as “Apple Inc.,” “quarterly revenue,” and “$100 billion.” This showcases the model’s proficiency in identifying key financial information from news articles, thus demonstrating its versatility and context-awareness across various domains.</p><p>Challenges such as computational resource requirements, domain adaptation, and model interpretability persist in using BERT for NER tasks. Ongoing research focuses on addressing these challenges through techniques like model compression, domain-specific pre-training, and enhancements to attention mechanisms.</p><p>Emerging trends in the NER landscape include multimodal NER, cross-lingual NER, and zero-shot NER, which promise to broaden the applications of entity recognition. Despite these challenges, BERT remains a cornerstone in NLP, offering a versatile and context-aware approach to NER.</p><p>In conclusion, mastering NER with BERT involves navigating challenges, leveraging best practices, and staying updated on emerging trends. As the NLP landscape continues to evolve, BERT serves as a catalyst for innovation and discovery in entity recognition. Whether you’re a seasoned researcher or an enthusiastic learner, the world of BERT in NER invites exploration and experimentation to unlock new possibilities in natural language understanding.</p><p>This article is written by: <a href="https://medium.com/u/14c24afdd987">Ilyes Ben Khalifa</a>.</p><p>Original source: <a href="https://ubiai.tools/mastering-named-entity-recognition-with-bert/">https://ubiai.tools/mastering-named-entity-recognition-with-bert/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca8d04b67b18" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubiai-nlp/mastering-named-entity-recognition-with-bert-ca8d04b67b18">Mastering Named Entity Recognition with BERT</a> was originally published in <a href="https://medium.com/ubiai-nlp">AI Process Automation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Vector Similarity Search Functions]]></title>
            <link>https://medium.com/ubiai-nlp/how-vector-similarity-search-functions-b5477c4e98b5?source=rss----8ee3d32a60e5---4</link>
            <guid isPermaLink="false">https://medium.com/p/b5477c4e98b5</guid>
            <dc:creator><![CDATA[Wiem Souai]]></dc:creator>
            <pubDate>Fri, 05 Apr 2024 15:15:20 GMT</pubDate>
            <atom:updated>2024-04-05T15:42:03.048Z</atom:updated>
            <content:encoded><![CDATA[<p>In the contemporary era dominated by data, comprehending the intricacies of navigating and analyzing vast information landscapes is crucial. Vector similarity search emerges as a key player in this endeavor, converting raw data into actionable insights across diverse domains. This method, grounded in the mathematical principles of vector spaces, empowers us to explore high-dimensional datasets with precision and efficiency, a notable departure from conventional text-based search methods. By assessing data points for proximity or similarity, it reveals hidden patterns and connections, facilitating advancements in fields ranging from machine learning to personalized recommendations. Exploring the mechanics and implications of similarity search unveils the essence of data-driven decision-making, underscoring its pivotal role in shaping the future trajectory of technology and innovation.</p><h3>Understanding Vectors in Data Representation</h3><p>Data points are depicted as vectors within a multidimensional space, significantly influencing the process of conducting similarity searches. Let’s delve deeper into the mechanics:</p><p>Vector Representation: In the realm of data science, a vector is an organized sequence of numbers, with each number representing a specific dimension or feature of the data. For example, for a 3-dimensional vector, it can be denoted as ⃗v = (v1, v2, v3).</p><p>High-Dimensional Space: These spaces encompass a large number of dimensions, allowing for the capture of intricate relationships between data points, which is essential for modern data analysis.</p><p>Examples:<br>- Text Data: Using the Bag of Words model, a text such as “cat on the mat” with a vocabulary of {cat, mat, on, the} can be represented as a text vector ⃗ = (1, 1, 1, 1).<br>- Image Data: For instance, a grayscale image measuring 2x2 can be depicted as an image vector ⃗ = (p1, p2, p3, p4), where each pi represents the intensity of the corresponding pixel.</p><h3>From Text to Images: Applying Similarity Search Across Domains</h3><p>Similarity search techniques play a crucial role in various domains, facilitating intricate analysis and retrieval tasks. Here’s an exploration of its diverse applications:</p><p>Text Analysis: In the realm of natural language processing (NLP), similarity search serves as a foundation for functions like detecting semantic similarities between documents. It aids in tasks such as plagiarism detection, content recommendation, and question-answering systems. For instance, vector space models translate textual content into numerical vectors, enabling the application of similarity metrics to identify closely related documents.</p><p>Image Retrieval: Similarity search is pivotal in image retrieval systems, allowing users to find images visually similar to a query image. This application finds widespread use in digital libraries, e-commerce platforms for product searches, and social media. Techniques like convolutional neural networks (CNNs) generate feature vectors for images, streamlining the retrieval process based on visual similarities.</p><p>Music and Audio Retrieval: Similarity search extends to the realm of audio, where algorithms analyze spectral features of music or sounds to recommend similar tracks or identify songs from fragments. Music streaming services leverage this technology to curate personalized playlists based on users’ listening preferences.</p><p>Bioinformatics: In bioinformatics, similarity search is instrumental in comparing genetic sequences, aiding in the identification of genes with analogous functions across diverse organisms. This comparison is crucial for elucidating evolutionary relationships and uncovering new genes.</p><p>These examples underscore the versatility and practicality of similarity search techniques, emphasizing their significance across a spectrum of disciplines.</p><h3>Technologies and Tools for Vector Similarity Search</h3><h3>FAISS: Fast Library for Approximate Nearest Neigh bors</h3><p>Overview: Tailored for clustering and similarity searches of dense vectors, particularly adept at handling large datasets through quantization and GPU acceleration.</p><p>Benefits: Offers notable enhancements in both speed and accuracy, particularly advantageous for large-scale image and video retrieval tasks.</p><p>Typical Use Cases: Ideal for searching within expansive image databases or extensive video libraries. For instance, a social media platform may leverage FAISS for swiftly locating visually akin user-uploaded photos.</p><h3>Annoy: Approximate Nearest Neighbors Oh Yeah</h3><p>Features: Facilitates memory-efficient searches utilizing static file-based indexes, ensuring ease of sharing indexes across systems.</p><p>When to Use It: Most suitable for scenarios demanding memory efficiency and dealing with static datasets. For example, a music recommendation system where the song vector index remains relatively stable and requires efficient distribution across platforms.</p><h3>Elasticsearch: Scalable Search and Analytics Engine</h3><p>How It Supports Vector Similarity Search: Employs “dense vector fields” to facilitate semantically relevant searches by comparing document embeddings.</p><p>Applications in Search Engines: Enhances the ability to retrieve conceptually similar results, even when users input different keywords. For instance, an online retailer can enhance the search experience by matching product descriptions more accurately with user queries.</p><h3>Comparative Analysis</h3><p>Performance: FAISS excels in large-scale searches, particularly with GPU support. Annoy is optimized for smaller, memory-sensitive environments. Elasticsearch, while versatile, may not match FAISS’s performance for handling large datasets.</p><p>Ease of Use: Elasticsearch is renowned for its user-friendly interface. Both Annoy and FAISS provide robust Python bindings but demand specialized expertise for effective utilization.</p><p>Scalability: FAISS scales efficiently with GPU resources, making it suitable for handling massive datasets. Elasticsearch is well-suited for distributed environments requiring horizontal scalability.</p><h3>Algorithms for Vector Similarity Search</h3><h3>Brute Force Search</h3><p>Overview: Entails comparing the query vector against every other vector in the dataset to identify the closest match.</p><p>Limitations:<br>- Scalability issues arise as the dataset expands, resulting in impractical computation times for large datasets.<br>- Incurs high computational costs when data structure or indexing strategies are not employed.</p><p>Example: Searching for a particular face within a database of millions entails comparing the query face against each entry in the database.</p><h3>Approximate Nearest Neighbors</h3><p>Explanation: The goal of approximate nearest neighbor (ANN) search is to find the closest neighbors “approximately” rather than precisely, sacrificing a small amount of accuracy in exchange for substantial speed gains.</p><p>Necessity for Scalability:<br>- The enhanced speed and reduced computational power and memory demands of ANN make it well-suited for real-time applications and handling large datasets.</p><p>Example: Spotify employs Annoy for music recommendations, where an exact match is not imperative, but swift performance and reasonable accuracy are vital.</p><h3>Popular Algorithms</h3><p>K-Nearest Neighbors (K-NN): Identifies the ‘k’ vectors closest to the query vector. Often employed in systems such as movie recommendations by comparing user preferences.</p><p>Locality-Sensitive Hashing (LSH): Groups vectors into “buckets” based on their similarity, thereby reducing the search space. Commonly utilized in image search applications to retrieve visually similar images by restricting comparisons to images within the same bucket.</p><p>Tree-Based Methods:<br>- KD-Trees: Divides data into a k-dimensional space, offering efficiency particularly in low-dimensional scenarios such as geographic location searches.<br>- Ball Trees: Organizes data within nested “balls,” making it suitable for high-dimensional spaces like feature vectors derived from images.</p><h3>Choosing the Right Algorithm</h3><p>The selection of the appropriate algorithm depends on factors such as dataset size, dimensionality, and whether processing is conducted in real-time or batch mode.</p><p>Dataset Size: Larger datasets typically benefit from approximate nearest neighbor (ANN) or locality-sensitive hashing (LSH) methods, while smaller datasets may suffice with brute-force or KD-trees approaches.</p><p>Dimensionality: High-dimensional data often necessitate algorithms like Ball trees or ANN methods to address the challenges posed by the curse of dimensionality.</p><p>Real-time vs. Batch Processing: Real-time applications prioritize faster, approximate methods like ANN, whereas batch processes can accommodate more accurate algorithms.</p><h3>Similarity Metrics: The Backbone of Vector Search</h3><p>Similarity metrics are integral to vector search, facilitating comparisons of high-dimensional data vectors. Let’s delve into some of the most significant metrics:</p><p>Cosine Similarity:<br>Cosine similarity assesses the cosine of the angle between two vectors. It evaluates the orientation rather than the magnitude of vectors in space, making it especially beneficial for text analysis. The formula is:<br>\[ \text{Cosine Similarity}(\vec{a}, \vec{b}) = \frac{\vec{a} \cdot \vec{b}}{\|\vec{a}\| \|\vec{b}\|} \]<br>where \( \vec{a} \cdot \vec{b} \) is the dot product of vectors \( \vec{a} \) and \( \vec{b} \), and \( \|\vec{a}\| \) and \( \|\vec{b}\| \) are the magnitudes of the vectors.</p><p>Euclidean Distance:<br>Euclidean distance, also known as the L2 norm, measures the “straight line” distance between two points in Euclidean space. It finds wide application in clustering and classification tasks. The formula for the Euclidean distance between two points \( \vec{a} \) and \( \vec{b} \) in space is:<br>\[ \text{Euclidean Distance}(\vec{a}, \vec{b}) = \sqrt{\sum_{i=1}^{n} (a_i — b_i)²} \]<br>where \( n \) is the number of dimensions of the vectors, and \( a_i \) and \( b_i \) are the components of \( \vec{a} \) and \( \vec{b} \) respectively.</p><p>These metrics play a vital role in similarity search, impacting the performance and suitability of various applications.</p><h3>Practical Applications of Vector Similarity Search</h3><p>Image Retrieval</p><p>How It Powers Image Search Engines:<br>- Converts images into high-dimensional vectors that represent unique features such as color, texture, and shape.<br>- Searches for images with vectors most similar to the query image, effectively retrieving images with similar content.</p><p>Examples:<br>- Google Photos: Utilizes vector similarity to search through photo libraries for specific objects, people, or scenes without requiring manual tagging.<br>- Stock Photo Services: Platforms like Shutterstock enable users to upload images to find visually similar stock photos, assisting designers and content creators.</p><p>Recommendation Systems</p><p>Role in Enhancing User Experience:<br>- Analyzes user behavior and item characteristics, converting them into vectors.<br>- Identifies items closest to a user’s preferences through vector similarity search, offering personalized recommendations.</p><p>Examples:<br>- Spotify: Generates music recommendation playlists by comparing the musical features of songs with a user’s listening history.<br>- E-commerce Platforms: Amazon recommends products by comparing user browsing and purchase history vectors with product catalogs, thereby enhancing shopping experiences.</p><h3>Using UBIAi to Enhance Vector Similarity Search</h3><p>UBIAi stands out as a crucial tool in the domain of vector similarity search, streamlining the creation and refinement of annotated datasets pivotal for training effective machine learning models driving these searches.</p><p>Precision in Data Annotation:<br>UBIAi offers an intuitive text annotation interface, simplifying the complexities associated with labeling large datasets. This ensures accurate annotation, crucial for developing vector representations that capture information nuances, thus enhancing similarity search algorithms’ effectiveness.</p><p>Multilingual Support for Global Applications:<br>UBIAi’s comprehensive multilingual text annotation support facilitates the development of linguistically inclusive and culturally aware models. This expands the reach and applicability of similarity search solutions, crucial in the global digital landscape.</p><p>Enhancing Search in OCR-Extracted Text:<br>UBIAi’s OCR annotation capabilities extend vector similarity search beyond digital text to include scanned documents and images. Particularly beneficial for industries relying on non-digital documents like legal and historical research, it enables more precise retrieval based on vector similarity.</p><p>Accelerated Model Development with Auto-Labeling:<br>UBIAi’s auto-labeling and pre-annotation features expedite similarity search model development. By automating initial data labeling stages, researchers and developers can focus on refining models, accelerating the process from concept to deployment.</p><p>Collaborative Dataset Creation:<br>UBIAi’s collaborative platform fosters team-based dataset creation and model training, speeding up dataset preparation and ensuring diverse annotation approaches. This results in more robust similarity search models.</p><p>By leveraging UBIAi’s capabilities, organizations can significantly improve the efficiency and accuracy of their vector similarity search systems. Its prowess in facilitating high-quality data annotation, supporting multilingual datasets, enabling efficient OCR-based searches, and expediting model development makes it indispensable in enhancing search and retrieval operations across various domains.</p><p>Through UBIAi, the pathway to developing advanced, inclusive, and efficient search and retrieval operations becomes clearer, highlighting AI tools’ transformative potential in optimizing operations across diverse domains.</p><h3>Challenges and Future Directions in Vector Similarity Search</h3><p>Scalability</p><p>Challenge: The challenge lies in scaling vector search to handle massive datasets without compromising performance or accuracy.</p><p>Strategies:<br>- Distributed Computing: Utilize cloud-based platforms to parallelize search processes, enabling efficient handling of large-scale datasets.<br>- Index Partitioning: Divide the search index into smaller segments for concurrent searching, facilitating scalability while maintaining performance.</p><p>Accuracy vs. Speed Trade-off</p><p>Challenge: Balancing quick response times for queries with the need for accurate search outcomes poses a significant challenge.</p><p>Approaches:<br>- Hybrid Models: Employ a combination of exact and approximate search methods tailored to the application’s requirements, prioritizing speed without sacrificing accuracy.<br>- Dynamic Algorithm Selection: Dynamically choose the search algorithm based on query complexity and dataset characteristics to optimize both speed and accuracy.</p><p>Emerging Technologies</p><p>Quantum Computing: Quantum computing holds the promise of revolutionizing vector similarity search by enabling extremely fast information processing, facilitating almost instantaneous searches across massive datasets.<br>AI and Machine Learning Enhancements: Advances in AI models enhance data understanding and categorization, empowering future algorithms to deliver more context-aware search capabilities.<br>Neural Hashing: Research into neural network-based hashing aims to achieve more efficient and precise encoding and retrieval of high-dimensional data vectors, potentially enhancing scalability and accuracy in vector similarity search.</p><h3>Conclusion</h3><p>In summary, vector similarity search represents a groundbreaking innovation in our capacity to navigate and interpret the vast, multidimensional data landscapes of the digital era. By delving into mathematical models for precise and efficient data retrieval, this technique has revolutionized various fields, spanning from personalized recommendations to bioinformatics. Through examining technologies like FAISS, Annoy, and Elasticsearch, alongside the foundational significance of similarity metrics such as cosine similarity and Euclidean distance, we’ve underscored the critical importance and dynamic nature of vector similarity search.</p><p>Despite encountering challenges related to scalability, accuracy, and speed, the future of vector similarity search is promising, driven by advancements in quantum computing, AI, and machine learning. These emerging technologies offer the potential to overcome current limitations, delivering more advanced search capabilities. Ultimately, vector similarity search serves as a testament to the potency of data-driven insights, heralding a future where our ability to sift through and interpret information knows no bounds.</p><p>Embrace the future of vector similarity search and contribute to shaping its evolution. Whether you’re involved in research, development, or simply passionate about technology, your participation can yield a significant impact. Explore, innovate, and collaborate to unlock new frontiers in data analysis and retrieval. The field awaits breakthroughs — let’s forge them together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5477c4e98b5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubiai-nlp/how-vector-similarity-search-functions-b5477c4e98b5">How Vector Similarity Search Functions</a> was originally published in <a href="https://medium.com/ubiai-nlp">AI Process Automation</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>