Posts

Showing posts from August, 2024

KB:Json Path Query

Image
Jason root = $ $.element. if you have "jq" installed you can use the -c 'path'  to see compacted list of all the elements.  the $ symbol is often used to represent the root element in JSON data when using tools or languages that support JSONPath, which is a query language for JSON data similar to XPath for XML. Here's why and how it's used: Why Use $ in JSONPath? Root Reference: The $ symbol in JSONPath represents the root object or array. It's a way to anchor your query to the very beginning of the JSON structure. Navigation: From the $ root, you can navigate through the JSON structure to access nested elements or values by specifying keys or indices.   Function Description Example Result text the plain text kind is {.kind} kind is List @ the current object {@} the same as input .  or  [] child operator {.kind} ,  {['kind']}  or  {['name\.type']} List .. recursive descent {..name} 127.0.0.1 127.0.0.2 myself e2e * wildcard. Get all ob...

KB:LLM Vectors vs Embeddings

Image
The sequence is from "Text" to "Tokens," then "Vectors," and finally "Embeddings." In data processing and machine learning, the creation or extraction of a vector typically precedes the embedding process. Initially, data is converted into a vector form, which is a numerical representation, and then, embeddings are generated from these vectors. Embeddings are lower-dimensional representations that capture the relationships and features of the data, making it easier to use in various machine learning models.  This generalized concept reflects the idea that vectors serve as the foundation upon which embeddings are built. When a model is trained, the initial vectorized values (those random vectors assigned at the beginning) don’t exist separately after the embeddings are created. Here’s how it works: Training Process: Initial Vectors: These are the starting points, just random numbers. They exist at the beginning of the training process but are not ...

KB:SQL DDL/DML

Image
DDL (Data Definition Language) provides the ability to define, create and modify database objects such as tables, views, indexes, and users. DML (Data Manipulation Language) allows for manipulating data in a database, such as inserting, updating, and deleting records. In SQL, DDL (Data Definition Language) and DML (Data Manipulation Language) are two categories of SQL commands used for different purposes: Data Definition Language (DDL) DDL commands are used to define and manage database schema, which includes creating, altering, and deleting database objects such as tables, indexes, and views. Common DDL commands include: CREATE : Used to create database objects like tables, indexes, views, etc. Example: CREATE TABLE Employees ( EmployeeID int PRIMARY KEY, FirstName varchar ( 255 ), LastName varchar ( 255 ), BirthDate date ); ALTER : Used to modify an existing database object. Example: ALTER TABLE Employees ADD COLUMN Salary decimal ( 10 , 2 ); DROP : Used to...