• In Pasadena, community-driven Practice is currently hiring
    archinect.com
    Following our previous look at an opening for aMuseum Technology Manager at the California Science Center, we are using this weeks edition of ourJob Highlights seriesto explore an open role on Archinect Jobs for aProject Captain at Practice (formerly GGA+).The role, based in Pasadena, calls for an individual who will engage with design, project execution, team leadership, quality control, marketing, and firm culture advocacy roles across the studio. Among the responsibilities for the role are coordinating project design and developing creative concepts, overseeing team adherence to project delivery standards, and developing and maintaining positive relationships with internal and external collaborators. A minimum of 5-7 years of postgraduate professional experience is required for the position.The California Endowment 'Hope Village' Restorative Health Campus. Image credit: PracticeWhy the role interests usAt a time when Pasadena has endured some of the worst destruction and...
    0 Comments ·0 Shares ·136 Views
  • Mortal Kombat 1 Conan the Barbarian Joins the Roster on January 28th, New Gameplay Revealed
    gamingbolt.com
    After revealing his in-game appearance and Brutality, NetherRealm confirmed that Conan the Barbarian will join Mortal Kombat 1s roster on January 28th. However, Kombat Pack 2 and Khaos Reigns owners can start playing on January 21st. Check out his gameplay trailer below.Based on the 1982 film of the same name and featuring Arnold Schwarzeneggers likeness, much of Conans moves involve his sword. Some particularly devastating moves include slicing and embedding his sword into an opponents shoulder before forcefully removing it, and powerful spins. He can also stab an enemy, his their body over his head and slam them down.As for his Fatality, its pretty straightforward, as Conan boils his opponent in a cauldron, later extracting their skull to admire it. Meanwhile, his Animality involves morphing into a bull and goring threats.Stay tuned for more details when Conan the Barbarian goes live. Mortal Kombat 1 is available for Xbox Series X/S, PS5, PC, and Nintendo Switch. Check out our reviews for the base game and Khaos Reigns.
    0 Comments ·0 Shares ·122 Views
  • See the Greek Biblical Inscription Embedded in an Ancient Mosaic Floor Discovered in Israel
    www.smithsonianmag.com
    Maayan Margulis and Shira Lifshitz clean the mosaic. Emil Aladjem / Israel Antiquities AuthorityArchaeologists have uncovered an ancient complex of ruinedByzantine-era buildings in Israel. The structures include a winepress, a large warehouse and what may be a monastery boasting a colorful mosaic floor. The floor features a Greek inscription from Deuteronomy: Blessed are you when you come in and blessed are you when you go out.The ruins were discovered during excavations ahead of construction for a new neighborhood near the city of Kiryat Gat. According to astatement from the Israel Antiquities Authority (IAA), the monastery dates to the fifth or sixth century C.E., when the region was part of theByzantine Empire.This is the largest and most significant site discovered in the region from the Roman and Byzantine periods, say excavation managersShira Lifshitz andMaayan Margulis in the statement. The site was found near the city ofKiryat Gat. Emil Aladjem / Israel Antiquities AuthorityThe researchers think the site was continuously occupied from the early Roman period (around the first century C.E.) until the end of the Byzantine period (in the late sixth century C.E.). However, as Margulis tellsHaaretzs Ruth Schuster, the sites first human occupation may have occurred some 6,000 years ago, during theChalcolithic era, or the Copper Age.During the first few centuries C.E., Christianity slowlyspread through the Roman Empire. In the 300s, the emperor Constantine I converted to Christianity, and a new Byzantine capital was founded in his name:Constantinople, which heralded the beginning of Byzantiums golden age.One of the ruined buildings at the newly discovered site may have been a monastery. Among its remains, archaeologists found imported wares, metal and glass containers, coins and marble artifacts. In the buildings main aisle, they also unearthed a decorative mosaic floor featuring crosses, lions, doves, flowers, geometric patterns, an amphora (an ancient jug) and the Bible verse. The mosaic contains clusters of small stones. Emil Aladjem / Israel Antiquities AuthorityThe monasterys mosaic floor contains clusters of very small, delicately placed stones, Lifshitz tells Haaretzwhich arent common in Israeli archaeology.The mosaic discovered in Kiryat Gat is one of the most unique ever found in Israel, says Mark Avrahami, the IAAs head of artistic conservation, in the statement. The team plans to put the tiled design on public display, but transferring mosaics is a complex process that requires great skill and precision.The mosaic will first be taken to a workshop for conservation, then placed in an open area of Kiryat Gat where the public can view it, says Svetlana Talis, the IAAs southern district director, in the statement.The discovery of the site highlights the historical richness of Kiryat Gat and its surroundings, shedding light on the centrality of the region in antiquity, Talis says.The sites other treasures include a very sophisticated wine press, complete with fermentation rooms and collecting vats. Its development and upkeep likely required significant financial resources, time and a range of professional work and effort, per the statement. Pottery artifacts and fragments suggest that the settlement may have included a ceramics factory.The excavation has revealed the remains of ten buildings so far, and the settlements true size remains to be seen. As Margulis tells Haaretz, We just began to excavate the site.Get the latest stories in your inbox every weekday.Filed Under: Ancient Civilizations, Ancient Rome, Archaeology, Artifacts, Byzantine Empire, Christianity, Cool Finds, History, Israel, Middle East , Religion, Roman Empire
    0 Comments ·0 Shares ·123 Views
  • Enterprises can now run real-time data through Google Clouds most advanced VMs
    venturebeat.com
    Early adopters like Couchbase are already seeing significant price-performance gains with Google Cloud's new VMs.Read More
    0 Comments ·0 Shares ·107 Views
  • 90% of Africa's games industry revenue generated by mobile games
    www.gamesindustry.biz
    90% of Africa's games industry revenue generated by mobile gamesBut almost 9 in 10 African developers are male, signalling "a need to foster greater inclusivity"Image credit: Africa Games Industry Report News by Vikki Blake Contributor Published on Jan. 16, 2025 A new report into Africa's games industry has revealed that 90% of its revenue is generated by mobile games.66 studios and 55 indie developers contributed to the 2024 Africa Game Developer Survey - a 42% increase on the previous year - of which 92% of survey participants were under 34 years old.However, just 12% of respondents were female, signalling "a clear need to foster greater inclusivity and diversity within the industry."South Africa leads with regard to revenue, generating over $110m between 2020 and 2023. Its overall market is projected to grow to $333 million by 2026, driven primarily by mobile gaming and esports.Nigeria's gaming market - "supported by a young, tech-savvy population and a growing esports scene - generated $249 million in 2021, whilst Kenya generated $46 million in the same year, with "significant growth in mobile gaming and a focus on educational, AR, and VR games.""The African games industry is surging forward, fuelled by a vibrant community and an unwavering spirit of innovation," said Hugo Obi, founder and CEO, Maliyo Games, which organised the survey."This year has witnessed remarkable milestones, from record participation in industry events to groundbreaking collaborations such as the Disney Iwj Rising Chef game."Despite challenges such as limited funding and access to international markets, the industry's momentum is undeniable. New voices are emerging alongside established veterans, creating a dynamic ecosystem supported by talent programmes, community meetups, and regional conferences."
    0 Comments ·0 Shares ·114 Views
  • Microsoft files patent for 'altering narrative experiences' with genAI
    www.gamedeveloper.com
    Justin Carter, Contributing EditorJanuary 16, 20252 Min ReadImage via Microsoft.At a GlanceThis genAI-related patent comes after Microsoft teamed with AI dev Inworld to create AI design tools for Xbox developers.Windows Central uncovered a 2024 patent from Microsoft on using generative AI to "aid in the creation of the game narrative."The patent, which was filed last June, abstractly describes using the technology or other foundational models to "create new game content responsive to player input, measure player engagement metrics during gameplay, and/or modify the game based on the generated new content and/or player engagement."Its more detailed description likens genAI elements to "co-pilots" for game designers that could use natural-language descriptions (or image and audio files) to "provide many creative variations" to designers. From there, a designer would "augment or refine the prompt based on the model output...to iteratively design the game, or its initial version."In November 2023, Microsoft struck a deal with AI developer Inworld to create a multi-platform AI toolset and character runtime engine. As it pertains to its various first-party teams, the latter was pitched with the possibility of generating stories, quests, and dialogue, which are key features to narrative-focused studios and their projects.Microsoft hopes you L3+R3 to accept genAIThe patent's description also notes how genAI could allow players to become a game's "co-creators...as a result of their exploration of and interaction with the game." It posits that genAI could use player tracking as a form of "implicit feedback for the next iteration of the game." As such, players could diverge from the developers' curated game experience and "explore new possibilities" which are then incorporated into subsequent iterations.Similar language about genAI's impact on games, and players in particular, has been used by executives at Netflix Games and EA. Major publishers have embraced the technology for various purposes, such as in-game moderation, AI companions, and creating models of real-world people.Meanwhile, a survey from last August shows developers still have reservations about it. Of those asked, 30 percent believe it will help reduce costs, and 35 percent think it'll similarly lead to reduced quality in games. Separately, a January 2024 survey revealed 31 percent of developers have taken to using genAI outside of work.As with the recently unveiled deluge of patents from Sony, Microsoft's patent doesn't instantly mean it has eyes on genAI for its future Xbox games. But it does offer a view into how the company thinks it could benefit its developers and player base as it charts out what to do with the technology.Read more about:Generative AIAbout the AuthorJustin CarterContributing Editor, GameDeveloper.comA Kansas City, MO native, Justin Carter has written for numerous sites including IGN, Polygon, and SyFy Wire. In addition to Game Developer, his writing can be found at io9 over on Gizmodo. Don't ask him about how much gum he's had, because the answer will be more than he's willing to admit.See more from Justin CarterDaily news, dev blogs, and stories from Game Developer straight to your inboxStay UpdatedYou May Also Like
    0 Comments ·0 Shares ·119 Views
  • SpaceX is about to attempt its seventh Starship rocket launch
    www.theverge.com
    SpaceXs next big launch is here. On Thursday at 5:37PM ET, Elon Musks space company will attempt to launch Starship for its 7th test flight from Boca Chica, Texas. You can watch the livestream from SpaceXs YouTube channel, on X, or its website.At 403 feet tall, Starship is the biggest launch vehicle ever. Its made up of two parts: the Starship spacecraft, which is designed to carry crew and cargo into orbit, and the Super Heavy Booster, which comes with 33 SpaceX Raptor engines that help propel Starship into space. Both the Starship spacecraft and its Super Heavy booster are reusable.Last year, SpaceXs launch tower successfully caught its Super Heavy following launch. The company will once again attempt to catch the booster with the launch towers chopstick arms.During its seventh test flight, Starship will attempt to deploy 10 Starlink simulators for the first time. These mock satellites are the same size and weight as Starlinks actual internet satellites, but they wont stay in space. Instead, theyll follow the same suborbital trajectory as Starship and are expected to demise upon entry.Starship also features major improvementsto reliability and performance this time around, making the vehicle slightly taller, according to SpaceX. Along with a redesigned propulsion system and an improved flight computer, Starship will debut a new heat shield with latest generation tiles and a backup layer to protect from missing or damaged tiles.
    0 Comments ·0 Shares ·97 Views
  • Chat with Your Documents Using Retrieval-Augmented Generation (RAG)
    www.marktechpost.com
    Imagine having a personal chatbot that can answer questions directly from your documentsbe it PDFs, research papers, or books. With Retrieval-Augmented Generation (RAG), this is not only possible but also straightforward to implement. In this tutorial, well learn how to build a chatbot that interacts with your documents, like PDFs, using Retrieval-Augmented Generation (RAG). Well use Groq for language model inference, Chroma as the vector store, and Gradio for the user interface.By the end, youll have a chatbot capable of answering questions directly from your documents, keeping context of your conversation, and providing concise, accurate answers.What is Retrieval-Augmented Generation (RAG)?Retrieval-Augmented Generation (RAG) is an AI architecture that enhances the capabilities of Large Language Models (LLMs) by integrating an information retrieval system. This system fetches relevant data from external sources, providing the LLM with grounded information to generate more accurate and contextually appropriate responses. By combining the generative abilities of LLMs with real-time data retrieval, RAG reduces inaccuracies and ensures up-to-date information in AI-generated content.PrerequisitesPython Installation: Ensure Python 3.9+ is installed on your system.Groq API Key: Sign up for a Groq account and generate an API key:Visit Groq Console.Navigate to API Keys and create a new key.Copy your API key for use in the project.Dependencies: Install the required libraries:pip install langchain langchain-community langchain-groq gradio sentence-transformers PyPDF2 chromadbThese libraries will help with language processing, building the user interface, model integration, PDF handling, and vector database management.Downloading the PDF ResourceFor this tutorial, well use a publicly available PDF containing information about diseases, their symptoms, and cures. Download the PDF and save it in your project directory (you are free to use any pdf).Step 1: Extracting Text from the PDFWell use PyPDF2 to extract text from the PDF:from PyPDF2 import PdfReaderdef extract_text_from_pdf(pdf_path): reader = PdfReader(pdf_path) text = "" for page in reader.pages: text += page.extract_text() return textpdf_path = 'diseases.pdf' # Replace with your PDF pathpdf_text = extract_text_from_pdf(pdf_path)Step 2: Split the Text into ChunksLong documents are divided into smaller, manageable chunks for processing.from langchain.text_splitter import RecursiveCharacterTextSplitterdef split_text_into_chunks(text, chunk_size=2000, chunk_overlap=200): text_splitter = RecursiveCharacterTextSplitter( chunk_size=chunk_size, chunk_overlap=chunk_overlap ) return text_splitter.split_text(text)text_chunks = split_text_into_chunks(pdf_text)Step 3: Create a Vector Store with ChromaWell embed the text chunks using a pre-trained model and store them in a Chroma vector database.from langchain.embeddings import SentenceTransformerEmbeddingsfrom langchain.vectorstores import Chromaembedding_model = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")vector_store = Chroma( collection_name="disease_info", embedding_function=embedding_model, persist_directory="./chroma_db")vector_store.add_texts(texts=text_chunks)Step 4: Initialize the Groq Language ModelTo use Groqs language model, set your API key and initialize the ChatGroq instance.import osfrom langchain_groq import ChatGroqos.environ["GROQ_API_KEY"] = 'your_groq_api_key_here' # Replace with your API keyllm = ChatGroq(model="mixtral-8x7b-32768", temperature=0.1)Step 5: Create the Conversational Retrieval ChainWith LangChains ConversationalRetrievalChain, we can link the language model and the vector database.from langchain.chains import ConversationalRetrievalChainretrieval_chain = ConversationalRetrievalChain.from_llm( llm=llm, retriever=vector_store.as_retriever(topk=3), return_source_documents=True)Step 6: Implement the Chatbot LogicWe define the logic for maintaining conversation history and generating responses.conversation_history = []def get_response(user_query): response = retrieval_chain({ "question": user_query, "chat_history": conversation_history }) conversation_history.append((user_query, response['answer'])) return response['answer']Step 7: Build the User Interface with GradioFinally, create a Gradio interface to interact with the chatbot.import gradio as grdef chat_interface(user_input, history): response = get_response(user_input) history.append((user_input, response)) return history, historywith gr.Blocks() as demo: chatbot = gr.Chatbot() state = gr.State([]) with gr.Row(): user_input = gr.Textbox(show_label=False, placeholder="Enter your question...") submit_btn = gr.Button("Send") submit_btn.click(chat_interface, inputs=[user_input, state], outputs=[chatbot, state])Running the CodeSave the script as app.py and runpython app.pyHurray! You are done. The Gradio interface will launch, allowing you to chat with your document.But why stop here? You can go further by trying to build any of the following functionalities in the chatbot.Enhanced Vector Store: Use other vector databases like Milvus or Pinecone for scalability.Fine-tuned Models: Experiment with fine-tuned Groq models for domain-specific accuracy.Multi-Document Support: Extend the system to handle multiple documents.Better Context Handling: Refine conversational logic to better manage longer chat histories.Custom UI: Design a more polished user interface with advanced styling and features.Congratulations! Youve successfully built a document-based chatbot using Groq and LangChain. Experiment with improvements and build something amazing! Resources:https://nios.ac.in/media/documents/SrSec314NewE/Lesson-29.pdfLangChain (https://www.langchain.com/)Groq (https://groq.com/)Also,dont forget to follow us onTwitter and join ourTelegram Channel andLinkedIn Group. Dont Forget to join our65k+ ML SubReddit.(Promoted) Vineet Kumar+ postsVineet Kumar is a consulting intern at MarktechPost. He is currently pursuing his BS from the Indian Institute of Technology(IIT), Kanpur. He is a Machine Learning enthusiast. He is passionate about research and the latest advancements in Deep Learning, Computer Vision, and related fields. Meet 'Height':The only autonomous project management tool (Sponsored)
    0 Comments ·0 Shares ·119 Views
  • Unlocking the Advantages of Semantic Chunking to Supercharge Your RAG Models
    towardsai.net
    Author(s): Aditya Baser Originally published on Towards AI. 1. Introduction1.1. What is chunking, and why do we need it?The intuition behind chunking and how it helps in the retrieval of informationImagine you are searching for a specific piece of information in a vast library. If the books are arranged haphazardly some with irrelevant sections bound together and others with critical pages scattered across volumes youd spend a frustrating amount of time flipping through unrelated content. Now, consider a library where each book is carefully organized by topic, with coherent sections that neatly encapsulate a single idea or concept. This is the intuition behind chunking in the context of retrieval-augmented generation (RAG): its about organizing information so it can be easily retrieved and understood.RAG Workflow Our emphasis would be on understanding chunkingChunking refers to the process of dividing large bodies of text into smaller, self-contained segments called chunks. Each chunk is designed to encapsulate a coherent unit of information that can be efficiently stored, retrieved, and used for downstream tasks like search, indexing, or contextual input for an LLM.1.2. What are the different types of chunking methods?Extending the library analogy, imagine you walk into the library to find information about The Effects of Climate Change on Marine Life. The way the books are organized will determine how easily you can find the specific information youre looking for:1.2.1. Fixed-Length ChunkingEvery book in the library is arbitrarily divided into fixed-sized sections, say, 100 pages each. No matter what the content is, each section stops at the 100-page mark. As a result, a chapter about coral bleaching might be split across two sections, leaving you scrambling to piece together the full information.Fixed-Length Chunking splits the text into chunks based on a fixed token, word, or character count. While this method is simple to implement, it often causes relevant information to be split among different chunks or for the same chunk to have information on different topics, making retrieval less accurate.1.2.2. Recursive Chunking (Hierarchical)The books are structured into sections, chapters, and paragraphs following their natural hierarchy. For instance, a book on climate change might have sections on global warming, rising sea levels, and marine ecosystems. However, if a section about marine life is too large, it may remain unwieldy and difficult to search through quickly.Recursive chunking breaks text hierarchically, following natural structures such as chapters, sections, or paragraphs. While it preserves the natural structure of the document it would lead to chunks that are too large for cases when sections are lengthy and poorly organized.1.2.3. Semantic ChunkingIn this case, the books are reorganized based on meaning and topic coherence. Instead of rigidly splitting sections by length or following a strict hierarchy, every section focuses on a specific topic or concept. For example, a section might cover The Impact of Rising Temperatures on Coral Reefs in its entirety, regardless of length, ensuring all related content stays together. As a result, you can retrieve exactly what you need without having to sift through unrelated material.Semantic chunking uses meaning or context to define chunk boundaries, often leveraging embeddings or similarity measures to detect where one topic ends and another begins.2. Semantic Chunking: 101Semantic chunking involves breaking text into smaller, meaningful units (chunks) that retain context and meaning.2.1. Why Semantic Chunking is SuperiorSemantic chunking stands out among chunking methods because it optimizes the retrieval process for contextual relevance, precision, and user satisfaction. In retrieval-augmented generation (RAG), where the goal is to feed highly relevant and coherent information into a large language model (LLM), semantic chunking eliminates many pitfalls associated with fixed-length and hierarchical approaches.Lets explore the unique advantages of semantic chunking and why it is crucial for building high-performance RAG systems.2.1.1. Context PreservationSemantic chunking ensures that each chunk contains complete, self-contained information related to a single topic. This contrasts with fixed-length chunking, were arbitrary boundaries often split context, leading to incomplete or fragmented information retrieval. When feeding an LLM, context completeness is critical. Missing context forces the LLM to hallucinate or generate suboptimal answers, while semantic chunking minimizes this risk by delivering coherent inputs.2.1.2. Improved Retrieval PrecisionSemantic chunking generates chunks that are tightly focused on specific topics. This makes it easier for retrieval systems to match queries to the most relevant chunks, improving the precision of retrieval. Precise retrieval reduces the number of irrelevant chunks passed to the LLM. This saves tokens, minimizes noise, and ensures the LLM focuses only on information that directly answers the query.2.1.3. Minimized RedundancySemantic chunking reduces overlap and redundancy across chunks. While some overlap is necessary for preserving context, semantic chunking ensures this is deliberate and optimized, unlike fixed-length chunking, where overlaps are arbitrary and often wasteful. RAG pipelines often must deal with token constraints. Redundancy wastes valuable token space, while semantic chunking maximizes the information density of each chunk.3. Implementing Semantic Chunking3.1. Loading the dataset and setting up the API keyWe will use the dataset jamescalam/ai-arxiv2, which contains research papers on artificial intelligence. These papers are often long and contain distinct sections like abstracts, methodologies, experiments, and conclusions. Chunking this dataset using semantic methods ensures we preserve context within sections and facilitate efficient retrieval for downstream tasks like summarization or question answering.Snippet of the dataset "jamescalam/ai-arxiv2Semantic chunking stands out by splitting text based on meaning and context rather than arbitrary rules, ensuring each chunk is coherent and self-contained.One of the key tools for implementing semantic chunking is the semantic_router package.Among its core features, the semantic_router.splitters module is specifically designed for splitting text into meaningful chunks using cutting-edge semantic methods.The semantic_router.splitters module is central to the chunking functionality. It offers three key chunking methodsconsecutive_sim, cumulative_sim, and rolling_windoweach catering to different document structures and use cases.To use OpenAIs tools, you need an API key for authentication, which we securely load from a .env file using the dotenv library. This keeps your key safe and out of your code. The OpenAIEncoder is then initialized to convert text into embeddingsnumerical representations of meaning and context. These embeddings are crucial for semantic chunking, enabling us to measure similarity between text segments and create coherent chunks. Make sure your API key is set up in the .env file, and the encoder is configured with a model like text-embedding-ada-002 for efficient and accurate embedding generation. Below is the code for the same from datasets import load_datasetimport osfrom getpass import getpassfrom semantic_router.encoders import OpenAIEncoderfrom dotenv import load_dotenvimport sysimport openai#import the datadataset = load_dataset("jamescalam/ai-arxiv2", split= "train")#Securly loading the openai api key from a .env fileopenai.api_key = os.environ["OPENAI_API_KEY"]#The OpenAIEncoder is initialized for accurate embedding generationencoder = OpenAIEncoder(name= "text-embedding-3-small")The below code uses the RollingWindowSplitter from the semantic_router package to semantically chunk the dataset. The rolling window technique creates overlapping chunks to maintain context across boundaries, making it particularly effective for NLP tasks like retrieval-augmented generation (RAG).The rolling window splits text into chunks of a specified size (defined by window_size) with overlaps between adjacent chunks. This overlap helps preserve context from one chunk to the next, ensuring downstream models, such as large language models (LLMs), receive coherent input for processing.3.2. RollingWindowSplitter Parameter BreakdownencoderThe encoder generates embeddings for the text, representing its semantic meaning. These embeddings help measure similarity and guide chunking.dynamic_threshold = FalseWhat it Does: Disables automatic adjustment of the similarity threshold based on content. This means chunks will be determined solely by the fixed parameters (window_size, min_split_tokens, etc.).Best Practice: Use False when you have a clear idea of your thresholds or if the dataset is consistent in structure. Use True for varied or unstructured datasets.min_split_tokens = 100What it Does: Ensures each chunk contains at least 100 tokens. This prevents overly small, uninformative chunks.Best Practice: Set this based on the minimum amount of information required for your task.max_split_tokens = 500What it Does: Caps each chunk at 500 tokens to fit within token limits for downstream models (e.g., OpenAI models with token constraints).Best Practice: Match this value to your LLMs token limit, subtracting space for query tokens and prompts.window_size = 2What it Does: Specifies how many segments (e.g., sentences, paragraphs) to include in each chunk. Smaller windows produce tighter chunks; larger windows preserve more context but may include unrelated content.Best Practice: Adjust based on the granularity of your text (e.g., use 12 for short sentences, 35 for paragraphs).plot_splits = TrueWhat it Does: Visualizes the chunking process, showing how the text was divided into chunks. This is helpful for debugging and parameter tuning.enable_statistics = TrueWhat it Does: Outputs statistics about the chunking process, such as the number of chunks and their average size. This helps evaluate how well your chunking configuration performs.from semantic_router.splitters import RollingWindowSplitterfrom semantic_router.utils.logger import loggerlogger.setLevel("WARNING") # reduce logs from splitterencoder.score_threshold = config.score_threshold#Read the above description to understand best practices for parameterssplitter = RollingWindowSplitter( encoder=encoder, dynamic_threshold = False, min_split_tokens = 100, max_split_tokens = 500, window_size = 2, plot_splits = False, # set this to true to visualize chunking enable_statistics = False# to print chunking stats)splits = splitter([dataset["content"][0]])The build_chunk function combines a title and a content chunk into a formatted string, where the title is prefixed with a # (indicating a heading in markdown) followed by the content. This is useful for creating easily readable and structured outputs, particularly when chunking large datasets like research papers. In the example, the title is taken from the first document in the dataset, and the function is applied to the first three chunks from the splits. By looping through these chunks, it prints them as well-organized sections, helping users see how each chunk relates to the overall document title. This approach ensures clarity and structure, making the output more comprehensible for tasks like summarization or retrieval.def build_chunk(title: str, content: str): return f"# {title}\n{content}"# we use it like:title = dataset[0]["title"]for s in splits[:3]: print("---") print(build_chunk(title=title, content=s.content))The build_metadata function creates a structured metadata list for a document and its corresponding chunks. It starts by extracting document-level metadata like the ArXiv ID, title, and references, then iterates over the provided chunks (doc_splits) to assign each chunk its own metadata. For each chunk, it adds identifiers for the current chunk, the previous chunk (prechunk_id), and the next chunk (postchunk_id) to maintain contextual links without storing the full neighboring chunks, which helps save storage in systems like Pinecone. This metadata structure is particularly useful for indexing and retrieval tasks, as it combines chunk-level context with document-wide details for efficient querying and navigation.from semantic_router.schema import DocumentSplitdef build_metadata(doc: dict, doc_splits: list[DocumentSplit]): # get document level metadata first arxiv_id = doc["id"] title = doc["title"] refs = list(doc["references"].values()) # init split level metadata list metadata = [] for i, split in enumerate(doc_splits): # get neighboring chunks prechunk_id = "" if i == 0 else f"{arxiv_id}#{i-1}" postchunk_id = "" if i+1 == len(doc_splits) else f"{arxiv_id}#{i+1}" # create dict and append to metadata list metadata.append({ "id": f"{arxiv_id}#{i}", "title": title, "content": split.content, "prechunk_id": prechunk_id, "postchunk_id": postchunk_id, "arxiv_id": arxiv_id, "references": refs }) return metadatametadata = build_metadata( doc=dataset[0], doc_splits=splits[:3])Metadata structureThis code connects to a Pinecone instance, a vector database optimized for storing and retrieving embeddings, using an API key for authentication. It checks if the specified index (configured with config.chunk_index_name) already exists. If not, it creates a new index with a specified dimensionality (dims), which matches the size of the embeddings generated by the encoder. The index uses the dotproduct similarity metric for vector comparisons, and ServerlessSpec specifies the cloud and region (e.g., us-east-1). The code waits for the index to initialize before connecting and displaying its stats. This setup ensures that your embeddings can be stored, queried, and managed efficiently for downstream tasks like semantic search or retrieval.To use Pinecone, you first need an API key to authenticate your connection. Head over to Pinecones website and sign up for a free account. Once logged in, navigate to the API Keys section in the Pinecone dashboard. Here, youll find an automatically generated key or the option to create a new one. Copy the key and store it securely in your environment variables file (e.g., .env) as PINECONE_API_KEY. This ensures your key remains private and can be accessed by your code without hardcoding it directly, enhancing security while enabling seamless integration.from pinecone import Pinecone# initialize connection to pinecone (get API key at app.pinecone.io)api_key = os.environ["PINECONE_API_KEY"] # configure clientpc = Pinecone(api_key=api_key)from pinecone import ServerlessSpecspec = ServerlessSpec( cloud= config.chunk_cloud, region= config.chunk_region # us-east-1 is the free one. )dims = len(encoder(["some random text"])[0])import timeindex_name = config.chunk_index_name# check if index already exists (it shouldn't if this is first time)if index_name not in pc.list_indexes().names(): # if does not exist, create index pc.create_index( index_name, dimension=dims, # dimensionality of embed 3 from openai metric='dotproduct', spec=spec ) # wait for index to be initialized while not pc.describe_index(index_name).status['ready']: time.sleep(1)# connect to indexindex = pc.Index(index_name)time.sleep(1)# view index statsindex.describe_index_stats()This code processes the dataset in batches to create semantic chunks, embed them, and store the results in a Pinecone index. It first converts the dataset into a Pandas DataFrame (limited to 10,000 documents for efficiency) and prepares a list, full_dataset, to store all chunk metadata. The splitter is configured to suppress statistics and visual outputs for faster processing. For each document, the splitter generates chunks, and build_metadata adds identifiers and metadata. Batches of chunks (batch_size = 128) are then processed, with unique IDs assigned to each chunk, embeddings generated using the encoder, and all data uploaded to the Pinecone index using the upsert method. This approach ensures scalable and efficient processing, embedding, and storage for large datasets in Pinecone, suitable for retrieval-augmented generation and semantic search.from tqdm.auto import tqdm# easier to work with dataset as pandas dataframedata = dataset.to_pandas().iloc[:10000] # limit to 10k docs# store dataset *without* embeddings herefull_dataset = []batch_size = 128# adjust splitter to not display stats and visualssplitter.enable_statistics = Falsesplitter.plot_splits = Falsefor doc in tqdm(dataset): # create splits splits = splitter([doc["content"]]) # create IDs and metadata for all splits in doc metadata = build_metadata(doc=doc, doc_splits=splits) for i in range(0, len(splits), batch_size): i_end = min(len(splits), i+batch_size) # get batch of data metadata_batch = metadata[i:i_end] full_dataset.extend(metadata_batch) # generate unique ids for each chunk ids = [m["id"] for m in metadata_batch] # get text content to embed content = [ build_chunk( title=x["title"], content=x["content"] ) for x in metadata_batch ] # embed text embeds = encoder(content) # add to Pinecone index.upsert(vectors=zip(ids, embeds, metadata))The query function retrieves relevant chunks from the Pinecone index based on a user's input query (text), embedding it using the same encoder used during index creation to ensure consistency in the semantic space. The function searches the index for the top k matches, where top_k=5 retrieves the 5 most similar chunks to the query based on the similarity metric (e.g., dot product, which measures alignment in the embedding space). It includes metadata for each match (include_metadata=True), such as the title, content, and IDs for the preceding (prechunk_id) and following (postchunk_id) chunks. Neighboring chunks are fetched to provide additional context, appending up to 400 characters from their edges to the current chunk. Each result is then formatted with the document's title as a heading and enriched with context for coherence, ensuring that the query response is accurate, relevant, and easy to understand.def query(text: str): xq = encoder([text])[0] #We are using the same encoder that we used while creating the index here so that the query is plotted in the same space matches = index.query( vector=xq, top_k=5, #How many chunks to retrive include_metadata=True #Allows us to get the metadata ) chunks = [] for m in matches["matches"]: content = m["metadata"]["content"] title = m["metadata"]["title"] pre = m["metadata"]["prechunk_id"] post = m["metadata"]["postchunk_id"] other_chunks = index.fetch(ids=[pre, post])["vectors"] prechunk = other_chunks[pre]["metadata"]["content"] postchunk = other_chunks[post]["metadata"]["content"] chunk = f"""# {title} {prechunk[-400:]} {content} {postchunk[:400]}""" chunks.append(chunk) return chunksquery("what are large language models?")Retrieving 5 relevant chunks from the database to be fed into the LLM modelReferencesDesign and Evaluation of RAG Solutions: Chunk Processing. (n.d.). Retrieved from https://github.com/Azure-Samples/Design-and-evaluation-of-RAG-solutions/blob/main/3.-chunk-processing/README.mdSemantic Chunking for RAG: Better Context, Better Results. (n.d.). Retrieved from https://www.multimodal.dev/post/semantic-chunking-for-ragRetrieval-Augmented Generation with Azure AI Document Intelligence. (n.d.). Retrieved from https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/concept/retrieval-augmented-generationRAG Techniques: Semantic Chunking. (n.d.). Retrieved from https://github.com/NirDiamant/RAG_Techniques/blob/main/all_rag_techniques/semantic_chunking.ipynbRAG Best Practice with AI Search. (n.d.). Retrieved from https://techcommunity.microsoft.com/blog/azure-ai-services-blog/rag-best-practice-with-ai-search/4357711Chunking Strategies for Production-Grade RAG Applications. (n.d.). Retrieved from https://www.helicone.ai/blog/rag-chunking-strategiesChunking Techniques Every Developer Should Know for Enhanced RAG Applications. (n.d.). Retrieved from https://dev.to/pavanbelagatti/chunking-techniques-every-developer-should-know-for-enhanced-rag-applications-famA Deep-Dive into Chunking Strategy, Chunking Methods, and Precision in RAG Applications. (n.d.). Retrieved from https://www.superteams.ai/blog/a-deep-dive-into-chunking-strategy-chunking-methods-and-precision-in-rag-applicationsRAG Optimization: Use an LLM to Chunk Your Text Semantically. (n.d.). Retrieved from https://www.luminis.eu/blog/rag-optimisation-use-an-llm-to-chunk-your-text-semantically/Mastering RAG: Advanced Chunking Techniques for LLM Applications. (n.d.). Retrieved from https://www.galileo.ai/blog/mastering-rag-advanced-chunking-techniques-for-llm-applicationsJoin thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming asponsor. Published via Towards AI
    0 Comments ·0 Shares ·105 Views
  • Lenovo Kicks Off the New Year With Great Discounts on Legion Gaming PCs and Laptops
    www.ign.com
    Lenovo is kicking off the new year with some great deals on several of its Legion gaming PC and laptop models. Most of these configurations have coupon codes that are automatically applied in your shopping cart, plus you get free shipping. Check out all the deals below.Lenovo Gaming PCsLenovo Legion Tower 7i Intel Core i9-14900KF RTX 4080 Super Gaming PCLenovo Legion Tower 5 AMD Ryzen 7 7700 RTX 4070 Ti Super Gaming PCLenovo Legion Tower 5 AMD Ryzen 7 7700 RTX 4070 Super Gaming PCLenovo Legion Tower 5 Intel Core i5-14400F RTX 4060 Gaming PCLenovo Gaming LaptopsLenovo Legion Pro 7 16" Intel Core i9-14900HX RTX 4090 Gaming LaptopLenovo Slim 5 16" AMD Ryzen 7 8845HS RTX 4070 Gaming LaptopLenovo Legion Pro 5 16" Intel Core i7-14700HX RTX 4070 Gaming LaptopLenovo Slim 5 16" AMD Ryzen 7 8845HS RTX 4060 Gaming LaptopLenovo Legion Pro 5 16" AMD Ryzen 7 7745HX RTX 4060 Gaming LaptopLenovo LOQ 15" Intel Core i7-13650HX RTX 4060 Gaming LaptopYou can quickly browse through all of the listed products on sale above.Lenovo Legion Tower 7 RTX 4080 Super Gaming PCLenovo Legion Tower 7i Intel Core i9-14900KF RTX 4080 Super Gaming PCThe Legion Tower 7i RTX 4080 Super gaming PC is currently available for just over $2,200 shipped. The 4080 Super is a second generation card that supersedes the RTX 4080. It's Nvidia's second most powerful card and a superior GPU to AMD's Radeon RX 7900 RTX if you factor in DLSS and ray tracing performance. In our RTX 4080 Super review, Jacqueline Thomas writes, "If you're in the market for a 4K graphics card around $1,000, it's hard to think of any GPU that's a better purchase right now."Lenovo Legion Tower 5 RTX 4070 Ti Super Gaming PCLenovo Legion Tower 5 AMD Ryzen 7 7700 RTX 4070 Ti Super Gaming PCThis Legion Tower 5 gaming PC is equipped with an RTX 4070 Ti Super GPU for under $1,600. The RTX 4070 Ti Super is a second gen RTX 40 series GPU; it's about 10% more powerful than the RTX 4070 Ti and 15-25% faster than the RTX 4070 Super. This is a great card for both 1440p and 4K gaming. The VRAM count is upped to 16GB compared the the RTX 4070 Ti's 12GB, which means it has the same amount of VRAM as the RTX 4080 Super. With this level of GPU power, enabling ray tracing is also a very real possibility in many games.Lenovo Legion Tower 5 i7 RTX 4070 Super Gaming PCLenovo Legion Tower 5 AMD Ryzen 7 7700 RTX 4070 Super Gaming PCThis Legion Tower 5 gaming PC features an RTX 4070 GPU for $1,425. The RTX 4070 Super is one of the best graphics cards for most people; it's affordably priced and yet it's powerful enough to run games at up to 4K (although 1440p is its sweet spot). In her RTX 4070 Super review, Jacqueline Thomas wrote that "the Nvidia GeForce RTX 4070 Super is the mid-range card we should have got back when the RTX 4000 generation launched. It's around 16% faster in most games at the same price. If you've been waiting to make your GPU upgrade, now's the time."Lenovo Legion Pro 7 16" RTX 4090 Gaming LaptopLenovo Legion Pro 7 16" Intel Core i9-14900HX RTX 4090 Gaming LaptopIf you're looking for an incredibly powerful gaming desktop replacement, this laptop is a strong contender. The Lenovo Legion Pro 7 gaming laptop features a 16" QHD+ display, Intel Core i9-14900HX CPU, RTX 4090 GPU, 32GB of RAM, and a 2TB SSD. The Intel Core i9-14900HX is Intel's most powerful CPU and excels at both gaming and workstation duties. The RTX 4090 is still the most powerful mobile GPU on the market, and by a very substantial margin. It's roughly equivalent to a desktop RTX 3090 GPU. It has more than enough power to run most games at well over 60fps on the 2560x1600 display. In fact, it could probably hit 240fps (the display has a 240Hz refresh rate).Lenovo Legion Pro 7 16" RTX 4070 Gaming LaptopLenovo Legion Pro 5 16" Intel Core i7-14700HX RTX 4070 Gaming LaptopThis Lenovo Legion Pro 7 gaming laptop offers a lot of upgrades for a very reasonable price. Unlike most laptops at this price point, it's equipped with an Intel Core i7-14700X, RTX 4070 GPU with the maximum TGP rating, 16GB of DDR5 RAM and a 1TB SSD. The RTX 4070 mobile GPU performs on par with the RTX 3080 and should provide ample horsepower to power games on the QHD+ display.Lenovo Legion Pro 5 RTX 4060 Gaming LaptopLenovo Legion Pro 5 16" AMD Ryzen 7 7745HX RTX 4060 Gaming LaptopThis Lenovo Legion Pro 5 gaming laptop features a 16" QHD+ display, a fully-powered AMD Ryzen 7 7745HX CPU, RTX 4060 GPU, 16GB of RAM, and a 1TB SSD. Performance-wise, the RTX 4060 mobile GPU sits right in between the RTX 3070 and RTX 3070 Ti. It should run most games smoothly on the QHD+ display, especially with DLSS enabled.Lenovo Legion Slim 16" Gaming LaptopsLenovo Slim 5 16" AMD Ryzen 7 8845HS RTX 4070 Gaming LaptopLenovo Slim 5 16" AMD Ryzen 7 8845HS RTX 4060 Gaming LaptopThe Lenovo Slim 5 Gen 9 is a current generation 2024 model. It weighs in at only 4.63 pounds and measures 0.78" at its thinnest point. The Legion Slim model is thinner than your typical gaming laptop, and yet is still equipped with a GPU that has the same high-wattage TGP as the full-sized Legion Pro.Why Choose Lenovo?Lenovo Legion gaming PCs and laptops generally feature better and more rugged build quality than what you'd find from most other prebuilt PCs. For desktop PCs in particular, people like the fact that Lenovo does not use many proprietary components in their rigs, so the PCs are much easier to upgrade with easiy obtainable, off-the-shelf parts. For laptops, Lenovo generally does not throttle the GPU on most of their Legion laptops, so you should expect maximum performance from a given GPU. Lenovo generally includes a solid one-year warranty with the option to extend.Why Should You Trust IGN's Deals Team?IGN's deals team has a combined 30+ years of experience finding the best discounts in gaming, tech, and just about every other category. We don't try to trick our readers into buying things they don't need at prices that aren't worth buying something at. Our ultimate goal is to surface the best possible deals from brands we trust and our editorial team has personal experience with. You can check out our deals standards here for more information on our process, or keep up with the latest deals we find on IGN's Deals account on Twitter.Eric Song is the IGN commerce manager in charge of finding the best gaming and tech deals every day. When Eric isn't hunting for deals for other people at work, he's hunting for deals for himself during his free time.
    0 Comments ·0 Shares ·115 Views