Tags: context* + python*

0 bookmark(s) - Sort by: Date ↓ / Title /

  1. Here’s the simplest version — key sentence extraction:


    <pre>
    ```
    def extract_relevant_sentences(document, query, top_k=5):
    sentences = document.split('.')
    query_embedding = embed(query)
    scored = »
    for sentence in sentences:
    similarity = cosine_sim(query_embedding, embed(sentence))
    scored.append((sentence, similarity))
    scored.sort(key=lambda x: x 1 » , reverse=True)
    return '. '.join( s[0 » for s in scored :top_k » ])
    ```
    </pre>

    For each sentence, compute similarity to the query. Keep the top 5. Discard the rest
  2. Python implementation of Recursive Language Models for processing unbounded context lengths. Process 100k+ tokens with any LLM by storing context as variables instead of prompts.
  3. Mem0: The Memory Layer for Personalized AI. Provides an intelligent, adaptive memory layer for Large Language Models (LLMs), enhancing personalized AI experiences.
    2024-07-29 Tags: , , , , , by klotz

Top of the page

First / Previous / Next / Last / Page 1 of 0 SemanticScuttle - klotz.me: tagged with "context+python"

About - Propulsed by SemanticScuttle