python

ChromaDB for the SQL Mind

ChromaDB for the SQL Mind

Hello, Chroma DB is a vector database which is useful for working with GenAI applications. In this article I will explore how can we run queries on Chroma DB by looking at similar relations in MySQL. Schema Unlike SQL you cannot define your own schema. In Chroma You get fixed Columns each with its own purpose: import chromadb #setiing up the client client = chromadb.Client() collection = client.create_collection(name="name") collection.add( documents = ["str1","str2","str3",...] ids = [1,2,3,....] metadatas=[{"chapter": "3", "verse": "16"},{"chapter":"3", "verse":"5"}, ..] embeddings = [[1,2,3], [3,4,5], [5,6,7]] ) Enter fullscreen mode Exit fullscreen mode Ids: They are unique ids. Note that…
Read More
Setting Up a Conda Environment for Your Python Projects

Setting Up a Conda Environment for Your Python Projects

When working on Python projects, it’s essential to create isolated environments to manage dependencies and avoid conflicts. This guide will help you install Anaconda, fix common issues, and set up a virtual environment for your projects. 1. Install Anaconda (in root terminal) First, install Anaconda by following this guide. Ensure that you have added Anaconda to your shell configuration (~/.zshrc or ~/.bashrc). After installation, verify by running: conda --version Enter fullscreen mode Exit fullscreen mode 2. Fix Conda Activation Errors If you encounter errors when running conda activate venv, such as permission issues, follow these steps to fix them: Adjust…
Read More
Jinbase – Multi-model transactional embedded database

Jinbase – Multi-model transactional embedded database

Hi Dev ! I'm Alex, a tech enthusiast. I'm excited to show you Jinbase, my multi-model transactional embedded database. Almost a year ago, I introduced Paradict, my take on multi-format streaming serialization. Given its readability, the Paradict text format appears de facto as an interesting data format for config files. But using Paradict to manage config files would end up cluttering its programming interface and making it confusing for users who still have choices of alternative libraries (TOML, INI File, etc.) dedicated to config files. So I used Paradict as a dependency for KvF (Key-value file format), a new project…
Read More
Getting to know Python Streamlit Web Framework

Getting to know Python Streamlit Web Framework

Hi, Community!In this article, I will introduce Python Streamlit Web Framework.Below, you can find the topics we will cover: 1-Introduction to Streamlit Web Framework 2-Installation of Streamlit module 3-Running Streamlit Application 4-Streamlit Basic commands 5-Display multimedia  6-Input widgets 7-Display progress and status 8-Sidebar and container 9-Data Visualization 10-Display a DataFrame   So, let's start with the first topic.1-Introduction to Python Streamlit Web Framework  Streamlit is an open-source Python framework that allows data scientists and machine learning engineers to create interactive web applications quickly and easily.With its simple syntax and effortless integration with popular data science libraries, Streamlit has become the front-runner for prototyping…
Read More
Flask or FastAPI: Choosing the Right Python Framework for Your Project

Flask or FastAPI: Choosing the Right Python Framework for Your Project

When it comes to Python web development, two frameworks stand out: Flask and FastAPI. Both are excellent tools, but they cater to different needs. Whether you're building a simple web app or a high-performance API, understanding their differences can help you make the right choice. Let’s break down the strengths and weaknesses of Flask and FastAPI so you can decide which one fits your project best. A Quick Overview of Flask Flask is the veteran framework, first introduced in 2010. It's a microframework, meaning it provides the essentials and lets you add features as needed. Flask is known for its…
Read More
Towards Effortless Python Configuration Files Version 1

Towards Effortless Python Configuration Files Version 1

Introduction As noted in the previous article the simplistic version is rife with problems including scalability, maintainability and extensibility. A simple extension from Version Ø is to try and hide the Python configuration details behind a property class. That is implement a pseudo data class that exposes a set of properties that allow a developer to simply do property set and get calls to retrieve and persist property values. From the maintainers point of view this implementation should support the following capabilities. Allow auto creation of configuration sections if they are missing Allow auto creation of property values if they…
Read More
Semantic Matching of Text Identifiers Using LASER Embeddings in Python

Semantic Matching of Text Identifiers Using LASER Embeddings in Python

When using OCR to digitize financial reports, you may encounter various approaches for detecting specific categories within those reports. For example, traditional methods like the Levenshtein algorithm can be used for string matching based on edit distance, making it effective for handling near matches, such as correcting typos or small variations in text. However, the challenge becomes more complex when you need to detect multiple categories in a single line of a report, especially when those categories may not appear exactly as expected or could overlap semantically. In this post, we analyze a semantic matching approach using Facebook's LASER (Language-Agnostic…
Read More
Finding the Way: Backtracking Algorithm for Rat in a Maze

Finding the Way: Backtracking Algorithm for Rat in a Maze

Introduction Imagine a rat searching for cheese in a complex maze. Every path looks promising until it hits a dead end. How can it systematically explore every route without missing any possible solution? This is where the Backtracking Algorithm comes in, a powerful tool for solving intricate puzzles and real-world problems. Backtracking is a recursive algorithmic technique that incrementally builds solutions and abandons paths that don’t lead to a valid solution. Its significance lies in its simplicity and versatility, making it applicable in fields like AI, robotics, and optimization. In this blog, we’ll dive into how backtracking works, explore its…
Read More
Day 8 – Modules

Day 8 – Modules

Modules: In Python, a module is a file containing Python definitions and statements. Modules allow you to organize your code into reusable pieces and help with maintaining and structuring your programs. A module is essentially a Python file (.py) Python provides built-in modules (like math, os, etc.). You can create your own custom modules. Modules have special variables: __name__: The name of the module. __file__: The file path of the module. __doc__ : The documentation string of a module. Enter fullscreen mode Exit fullscreen mode In Python, identifiers starting and ending with double underscores (like name, doc, etc.) are called…
Read More
How to Create Custom Plans with “plan.md” in Goose

How to Create Custom Plans with “plan.md” in Goose

What is Goose?Goose is a developer agent that enhances software development by automating coding tasks within your terminal or IDE. Guided by your input, it intelligently analyzes your project’s needs, generates the necessary code, and implements changes autonomously. When working with Goose, having a structured way to guide its execution toward specific goals is essential. This is where the plan.md file comes in. A plan.md file allows you to define a customized plan for Goose, using flexible text formatting and the power of Jinja templating to create dynamic, reusable, and goal-oriented plans. How to Set Up GooseBefore creating your custom…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.