@@ -48,22 +48,22 @@ dotnet add package Microsoft.ML
4848In a new C# file, import the required classes. Note that the ` #pragma `
4949directive suppresses warnings about the experimental status of the vector set API:
5050
51- {{< clients-example set="home_vecsets" step="import" lang_filter="C#" >}}
51+ {{< clients-example set="home_vecsets" step="import" lang_filter="C#-Sync " >}}
5252{{< /clients-example >}}
5353
5454## Access the model
5555
5656Use the ` GetPredictionEngine() ` helper function declared in the example below to load the model that creates the embeddings:
5757
58- {{< clients-example set="home_vecsets" step="model" lang_filter="C#" >}}
58+ {{< clients-example set="home_vecsets" step="model" lang_filter="C#-Sync " >}}
5959{{< /clients-example >}}
6060
6161The ` GetPredictionEngine() ` function uses two classes, ` TextData ` and ` TransformedTextData ` ,
6262to specify the ` PredictionEngine ` model. These have a very simple definition
6363and are required because the model expects the input and output to be
6464passed in named object fields:
6565
66- {{< clients-example set="home_vecsets" step="data_classes" lang_filter="C#" >}}
66+ {{< clients-example set="home_vecsets" step="data_classes" lang_filter="C#-Sync " >}}
6767{{< /clients-example >}}
6868
6969Note that you must declare these classes at the end of the source file
@@ -73,15 +73,15 @@ The `GetEmbedding()` function declared below can then use this model to
7373generate an embedding from a section of text and return it as a ` float[] ` array,
7474which is the format required by the vector set API:
7575
76- {{< clients-example set="home_vecsets" step="get_embedding" lang_filter="C#" >}}
76+ {{< clients-example set="home_vecsets" step="get_embedding" lang_filter="C#-Sync " >}}
7777{{< /clients-example >}}
7878
7979## Create the data
8080
8181The example data is contained a ` Dictionary ` object with some brief
8282descriptions of famous people:
8383
84- {{< clients-example set="home_vecsets" step="data" lang_filter="C#" >}}
84+ {{< clients-example set="home_vecsets" step="data" lang_filter="C#-Sync " >}}
8585{{< /clients-example >}}
8686
8787## Add the data to a vector set
@@ -99,7 +99,7 @@ The call to `VectorSetAdd()` also adds the `born` and `died` values from the
9999original dictionary as attribute data. You can access this during a query
100100or by using the [ ` VectorSetGetAttributesJson() ` ] ({{< relref "/commands/vgetattr" >}}) method.
101101
102- {{< clients-example set="home_vecsets" step="add_data" lang_filter="C#" >}}
102+ {{< clients-example set="home_vecsets" step="add_data" lang_filter="C#-Sync " >}}
103103{{< /clients-example >}}
104104
105105## Query the vector set
@@ -112,7 +112,7 @@ return elements of the set, ranked in order of similarity to the query.
112112
113113Start with a simple query for "actors":
114114
115- {{< clients-example set="home_vecsets" step="basic_query" lang_filter="C#" >}}
115+ {{< clients-example set="home_vecsets" step="basic_query" lang_filter="C#-Sync " >}}
116116{{< /clients-example >}}
117117
118118This returns the following list of elements (formatted slightly for clarity):
@@ -131,7 +131,7 @@ on the information contained in the embedding model.
131131You can use the ` Count ` property of ` VectorSetSimilaritySearchRequest ` to limit the
132132list of elements to just the most relevant few items:
133133
134- {{< clients-example set="home_vecsets" step="limited_query" lang_filter="C#" >}}
134+ {{< clients-example set="home_vecsets" step="limited_query" lang_filter="C#-Sync " >}}
135135{{< /clients-example >}}
136136
137137The reason for using text embeddings rather than simple text search
@@ -141,7 +141,7 @@ different. For example, the word "entertainer" doesn't appear in any of the
141141descriptions but if you use it as a query, the actors and musicians are ranked
142142highest in the results list:
143143
144- {{< clients-example set="home_vecsets" step="entertainer_query" lang_filter="C#" >}}
144+ {{< clients-example set="home_vecsets" step="entertainer_query" lang_filter="C#-Sync " >}}
145145{{< /clients-example >}}
146146
147147Similarly, if you use "science" as a query, you get the following results:
@@ -162,7 +162,7 @@ with `VectorSetSimilaritySearch()` to restrict the search further. For example,
162162repeat the "science" query, but this time limit the results to people
163163who died before the year 2000:
164164
165- {{< clients-example set="home_vecsets" step="filtered_query" lang_filter="C#" >}}
165+ {{< clients-example set="home_vecsets" step="filtered_query" lang_filter="C#-Sync " >}}
166166{{< /clients-example >}}
167167
168168Note that the boolean filter expression is applied to items in the list
0 commit comments