-
Notifications
You must be signed in to change notification settings - Fork 414
Add project for cook book utilities #3217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| namespace Microsoft.DotNet.Interactive.AIUtilities; | ||
|
|
||
| public static class TextChunkingExtensions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on a better name? What else is going to end up in the category of string operations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm probably will be template parameter parsing?
| }; | ||
|
|
||
| Func<string, float[]> stringToFloatArray = a => a.Select(c => (float)c).ToArray(); | ||
| var search = collection.Search( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this signature very well. Let's work on simplifying.
| public float Score(T a, TQuery query); | ||
| } | ||
|
|
||
| public class CosineSimilarityComparer<T> : ISimilarityComparer<T, float[]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate files please.
src/Microsoft.DotNet.Interactive.AIUtilities/SemanticCollection.cs
Outdated
Show resolved
Hide resolved
| }; | ||
|
|
||
| var search = collection.OrderBySimilarity( | ||
| var search = collection.ScoreBySimilarity( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe ScoreBySimilarityTo("diego")?
Adding