Skip to content
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

feat: [sc-25972] Refine NameRank SDK #515

Merged
merged 7 commits into from
Jan 6, 2025

Conversation

Carbon225
Copy link
Collaborator

Copy link

changeset-bot bot commented Dec 31, 2024

🦋 Changeset detected

Latest commit: bb8c68b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@namehash/namerank Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Dec 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
namekit.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 5, 2025 10:27pm
namerank.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 5, 2025 10:27pm
5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples.nameguard.io ⬜️ Skipped (Inspect) Jan 5, 2025 10:27pm
namegraph.dev ⬜️ Skipped (Inspect) Jan 5, 2025 10:27pm
nameguard.io ⬜️ Skipped (Inspect) Jan 5, 2025 10:27pm
namehashlabs.org ⬜️ Skipped (Inspect) Jan 5, 2025 10:27pm
storybook.namekit.io ⬜️ Skipped (Inspect) Jan 5, 2025 10:27pm

Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Carbon225 Hey great to see the updates here. Reviewed in detail and shared feedback 👍 @djstrong FYI

word_count: number;

/** The most likely tokenization of the label */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Can we please document in detail the rules for if this field is defined or not? This will be very helpful!

@@ -9,24 +9,345 @@ export enum LabelStatus {
Unknown = "unknown",
}

// Character and grapheme types can potentially evolve independently.

export enum CharacterType {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Carbon225 It's great to see the added documentation! In my understanding, we should already have most or all of these defined and documented in the NameGuard SDK? We shouldn't duplicate these definitions here. Instead, we should import from the NameGuard SDK wherever relevant. Thank you! @djstrong FYI

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these are present in NameGuard SDK.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djstrong Ah, I see. Am I correct to assume that these ideas are actually related to the LabelInspector? Assuming so, what do you think about creating a separate labelinspector.ts file that you could move those definitions into, and then importing those definitions back into this file.

My goal here is to keep this file more "pure" to NameRank.

I don't suggest we create a separate typescript package for a LabelInspector SDK in this PR. This would be a nice goal for a separate PR, where we might move this labelinspector.ts file into a separate package, but for now just creating a new and separate file in this current package is ok 👍

Appreciate your advice!

interesting_score: number;

/** Detailed NLP analysis of the name */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please document what can cause this field to be undefined?

tokenizations: Record<string, any>[];
}

export interface NameRankReport {
/** Score indicating the purity/cleanliness of the name */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please document the range of values this could be? Ex: 0 to 1? Inclusive / exclusive?

purity_score: number;

/** Score indicating how interesting/memorable the name is */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please document the range of values this could be? Ex: 0 to 1? Inclusive / exclusive?

top_tokenization?: string[];

/** All possible tokenizations of the label */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really true that this will always have all possible tokenizations? I imagine there's some kind of a limit to how many we might generate / return?

status: LabelStatus;

/** The probability of the label */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's please document in a bit more detail what this "probability" is intended to symbolically represent.

log_probability: number;

/** The number of words in the label */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please document more details about this word_count field? For example, is it sometimes 0 or undefined? What happens if we can't find any words? And when we do return a positive word_count value, how does this value relate to the top_tokenization field?

top_tokenization?: string[];

/** All possible tokenizations of the label */
tokenizations: Record<string, any>[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's please also define an interface for the value of each of these records. We should avoid the use of any.

@djstrong djstrong force-pushed the jakubkarbowski/sc-25972/refine-namerank-sdk branch from 4164e5b to 74488e8 Compare January 3, 2025 21:53
@vercel vercel bot temporarily deployed to Preview – namegraph.dev January 3, 2025 21:53 Inactive
@vercel vercel bot temporarily deployed to Preview – storybook.namekit.io January 3, 2025 21:53 Inactive
@vercel vercel bot temporarily deployed to Preview – nameguard.io January 3, 2025 21:53 Inactive
@vercel vercel bot temporarily deployed to Preview – examples.nameguard.io January 3, 2025 21:53 Inactive
@vercel vercel bot temporarily deployed to Preview – namehashlabs.org January 3, 2025 21:53 Inactive
@vercel vercel bot temporarily deployed to Preview – storybook.namekit.io January 3, 2025 23:02 Inactive
@vercel vercel bot temporarily deployed to Preview – examples.nameguard.io January 3, 2025 23:02 Inactive
Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djstrong Hey super updates! Thank you. Reviewed and shared feedback 👍

packages/namerank-sdk/src/index.ts Outdated Show resolved Hide resolved
packages/namerank-sdk/src/index.ts Outdated Show resolved Hide resolved
packages/namerank-sdk/src/index.ts Outdated Show resolved Hide resolved
export interface NLPLabelAnalysis {
inspection: any;
/** The result of the label inspection */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also document here that inspection will be of type InspectorResultNormalized if status is Normalized and otherwise will be of type InspectorResultUnnormalized?

What if status is Unknown?

packages/namerank-sdk/src/index.ts Outdated Show resolved Hide resolved
interesting_score: number;

/**
* The result of the NLP analysis on the label. If the label is not inspected, this field will be undefined.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we refine this to make it very explicit what it means for the label not to be inspected? What field / field value would define this case?

@@ -9,24 +9,345 @@ export enum LabelStatus {
Unknown = "unknown",
}

// Character and grapheme types can potentially evolve independently.

export enum CharacterType {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djstrong Ah, I see. Am I correct to assume that these ideas are actually related to the LabelInspector? Assuming so, what do you think about creating a separate labelinspector.ts file that you could move those definitions into, and then importing those definitions back into this file.

My goal here is to keep this file more "pure" to NameRank.

I don't suggest we create a separate typescript package for a LabelInspector SDK in this PR. This would be a nice goal for a separate PR, where we might move this labelinspector.ts file into a separate package, but for now just creating a new and separate file in this current package is ok 👍

Appreciate your advice!

@vercel vercel bot temporarily deployed to Preview – examples.nameguard.io January 5, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – namehashlabs.org January 5, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – storybook.namekit.io January 5, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – nameguard.io January 5, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – namegraph.dev January 5, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – storybook.namekit.io January 5, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – namehashlabs.org January 5, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – nameguard.io January 5, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – namegraph.dev January 5, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – examples.nameguard.io January 5, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – namegraph.dev January 5, 2025 22:26 Inactive
@vercel vercel bot temporarily deployed to Preview – storybook.namekit.io January 5, 2025 22:26 Inactive
@vercel vercel bot temporarily deployed to Preview – namehashlabs.org January 5, 2025 22:26 Inactive
@vercel vercel bot temporarily deployed to Preview – examples.nameguard.io January 5, 2025 22:26 Inactive
@vercel vercel bot temporarily deployed to Preview – nameguard.io January 5, 2025 22:26 Inactive
Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djstrong Great updates! Reviewed and approved 🚀

@lightwalker-eth lightwalker-eth merged commit a1842e6 into main Jan 6, 2025
20 checks passed
@lightwalker-eth lightwalker-eth deleted the jakubkarbowski/sc-25972/refine-namerank-sdk branch January 6, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants