Posts

EF Core 11: Vector Search Features with SQL Server

Image
In this article we will see the EF Core 11 Vector Search Feature. Please note that, the following items come from EF Core 11. Only the first two are used directly in this application. Vector properties are not loaded by default. A SqlVector<T> property is no longer included in the SELECT list when you materialize an entity. A 1536-dimension float vector is roughly 6 KB per row, and most queries never need it back. In this app the vector is only used inside ORDER BY , so nothing extra is transferred. Exact vector distance. EF.Functions.VectorDistance(metric, vector1, vector2) , introduced in EF Core 10, keeps working and maps to the T-SQL VECTOR_DISTANCE function. This is what the application uses. Approximate vector search (experimental). EF Core 11 adds translation for the SQL Server VECTOR_SEARCH function, which runs against a DiskANN vector index. It is marked experimental on the SQL Server side, so the API may change. The application in this article does not use it...

ML.NET: Sentiment Analysis with Binary Classification

Image
In this article, we will build an ASP.NET Core 10 MVC application that finds out whether a statement typed by the user is Positive or Negative . The training data comes from a SQL Server table, the model is built with ML.NET using binary classification, and the application keeps working correctly when new rows are inserted in the table while it is running. We will go step by step. First we create the database and the table. Then we create the MVC project, add the packages and write the classes one by one. After each piece of code, we will see what the code is doing. At the end we will look closely at how the application handles new rows in the table, including the Refresh model now button that has a 2 minute timer and posts to the server by itself when nobody clicks it. Figure 1: The architecture of the application. The request path is on top and the training path is below it. What is ML.NET? ML.NET is an open source and cross platform machine learning framework from Micros...