-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Stopwords remover xml documentation #3413
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
Changes from 3 commits
ea847a9
eb72063
7e1016c
818ec4a
a8049d9
f3f9003
5c5fc26
abff8d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,10 +61,7 @@ public ITransformer CreateComponent(IHostEnvironment env, IDataView input, OneTo | |
} | ||
|
||
/// <summary> | ||
/// A Stopword remover transform based on language-specific lists of stop words (most common words) | ||
/// from Office Named Entity Recognition project. | ||
/// The transform is usually applied after tokenizing text, so it compares individual tokens | ||
/// (case-insensitive comparison) to the stopwords. | ||
/// <see cref="ITransformer"/> resulting from fitting a <see cref="StopWordsRemovingEstimator"/>. | ||
/// </summary> | ||
public sealed class StopWordsRemovingTransformer : OneToOneTransformerBase | ||
{ | ||
|
@@ -483,10 +480,25 @@ private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> a | |
} | ||
|
||
/// <summary> | ||
/// Stopword remover removes language-specific list of stop words (most common words) | ||
/// This is usually applied after tokenizing text, so it compares individual tokens | ||
/// (case-insensitive comparison) to the stopwords. | ||
/// <see cref="IEstimator{TTransformer}"/> for the <see cref="CustomStopWordsRemovingTransformer"/>. | ||
/// </summary> | ||
/// <remarks> | ||
/// <format type="text/markdown"><![CDATA[ | ||
/// ### Estimator Characteristics | ||
/// | | | | ||
/// | -- | -- | | ||
/// | Does this estimator need to look at the data to train its parameters? | No | | ||
/// | Input column data type | Vector of [Text]<xref:System.ReadOnlyMemory{System.Char}> | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
should this be known-sized? #ByDesign There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it can be either known-sized or unknown size. In reply to: 276871092 [](ancestors = 276871092) |
||
/// | Output column data type | Vector of unknown size of [Text]<xref:System.ReadOnlyMemory{System.Char}> | | ||
/// | ||
/// The resulting <xref:Microsoft.ML.Transforms.Text.StopWordsRemovingTransformer/> creates a new column, named as specified in the output column name parameters, and | ||
/// fills it with vector of strings similar to vector of strings in input column but removing all, predefined for certain language, strings from it. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
replace strings with texts? #Resolved |
||
/// All text comparison made by casting predefined text and text from input column to lower case using casing rules of invariant culture. | ||
/// See the See Also section for links to examples of the usage. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest: The resulting xref:Microsoft.ML.Transforms.Text.StopWordsRemovingTransformer/ creates a new column, named as specified in the output column name parameter, and fills it with a vector of words containing all of the words in the input column **except the predefined list of stopwords for the specified language. #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good! Small type: extra ** in there |
||
/// ]]> | ||
/// </format> | ||
/// </remarks> | ||
/// <seealso cref="TextCatalog.RemoveDefaultStopWords(TransformsCatalog.TextTransforms, string, string, Language)" /> | ||
public sealed class StopWordsRemovingEstimator : TrivialEstimator<StopWordsRemovingTransformer> | ||
{ | ||
/// <summary> | ||
|
@@ -627,9 +639,7 @@ public override SchemaShape GetOutputSchema(SchemaShape inputSchema) | |
} | ||
|
||
/// <summary> | ||
/// Custom stopword remover removes specified list of stop words. | ||
/// This is usually applied after tokenizing text, so it compares individual tokens | ||
/// (case-insensitive comparison) to the stopwords. | ||
/// <see cref="ITransformer"/> resulting from fitting a <see cref="CustomStopWordsRemovingEstimator"/>. | ||
/// </summary> | ||
public sealed class CustomStopWordsRemovingTransformer : OneToOneTransformerBase | ||
{ | ||
|
@@ -1076,10 +1086,25 @@ protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, b | |
} | ||
|
||
/// <summary> | ||
/// Custom stopword remover removes specified list of stop words. | ||
/// This is usually applied after tokenizing text, so it compares individual tokens | ||
/// (case-insensitive comparison) to the stopwords. | ||
/// <see cref="IEstimator{TTransformer}"/> for the <see cref="CustomStopWordsRemovingTransformer"/>. | ||
/// </summary> | ||
/// <remarks> | ||
/// <format type="text/markdown"><![CDATA[ | ||
/// ### Estimator Characteristics | ||
/// | | | | ||
/// | -- | -- | | ||
/// | Does this estimator need to look at the data to train its parameters? | No | | ||
/// | Input column data type | Vector of [Text]<xref:System.ReadOnlyMemory{System.Char}> | | ||
/// | Output column data type | Vector of unknown size of [Text]<xref:System.ReadOnlyMemory{System.Char}> | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
how about "Unknown-sized vector of"? #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unspecified? #ByDesign |
||
/// | ||
/// The resulting <xref:Microsoft.ML.Transforms.Text.CustomStopWordsRemovingTransformer/> creates a new column, named as specified in the output column name parameters, and | ||
/// fills it with vector of strings similar to vector of strings in input column but removing all specified strings from it. | ||
/// All text comparison made by casting specified text and text from input column to lower case using casing rules of invariant culture. | ||
/// See the See Also section for links to examples of the usage. | ||
/// ]]> | ||
/// </format> | ||
/// </remarks> | ||
/// <seealso cref="TextCatalog.RemoveStopWords(TransformsCatalog.TextTransforms, string, string, string[])" /> | ||
public sealed class CustomStopWordsRemovingEstimator : TrivialEstimator<CustomStopWordsRemovingTransformer> | ||
{ | ||
/// <summary> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,12 +251,14 @@ internal static NgramExtractingEstimator ProduceNgrams(this TransformsCatalog.Te | |
=> new NgramExtractingEstimator(Contracts.CheckRef(catalog, nameof(catalog)).GetEnvironment(), columns); | ||
|
||
/// <summary> | ||
/// Removes stop words from incoming token streams in <paramref name="inputColumnName"/> | ||
/// and outputs the token streams without stopwords as <paramref name="outputColumnName"/>. | ||
/// Create a <see cref="CustomStopWordsRemovingEstimator"/>, which copies the data from the column specified in <paramref name="inputColumnName"/> | ||
/// to a new column: <paramref name="outputColumnName"/> and removes predifined set of text specific for <paramref name="language"/> from it. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
for later: we should that these language-specific lists to docs. |
||
/// </summary> | ||
/// <param name="catalog">The text-related transform's catalog.</param> | ||
/// <param name="outputColumnName">The column containing output text. Null means <paramref name="inputColumnName"/> is replaced.</param> | ||
/// <param name="inputColumnName">The column containing text to remove stop words on.</param> | ||
/// <param name="catalog">The transform's catalog.</param> | ||
/// <param name="outputColumnName">Name of the column resulting from the transformation of <paramref name="inputColumnName"/>. | ||
/// This column's data type will be unknown size vector of text.</param> | ||
/// <param name="inputColumnName">Name of the column to copy the data from. | ||
/// This estimator operates over vector of text.</param> | ||
/// <param name="language">Langauge of the input text column <paramref name="inputColumnName"/>.</param> | ||
/// <example> | ||
/// <format type="text/markdown"> | ||
|
@@ -272,12 +274,14 @@ public static StopWordsRemovingEstimator RemoveDefaultStopWords(this TransformsC | |
=> new StopWordsRemovingEstimator(Contracts.CheckRef(catalog, nameof(catalog)).GetEnvironment(), outputColumnName, inputColumnName, language); | ||
|
||
/// <summary> | ||
/// Removes stop words from incoming token streams in <paramref name="inputColumnName"/> | ||
/// and outputs the token streams without stopwords as <paramref name="outputColumnName"/>. | ||
/// Create a <see cref="CustomStopWordsRemovingEstimator"/>, which copies the data from the column specified in <paramref name="inputColumnName"/> | ||
/// to a new column: <paramref name="outputColumnName"/> and removes text specified in <paramref name="stopwords"/> from it. | ||
/// </summary> | ||
/// <param name="catalog">The text-related transform's catalog.</param> | ||
/// <param name="outputColumnName">The column containing output text. Null means <paramref name="inputColumnName"/> is replaced.</param> | ||
/// <param name="inputColumnName">The column containing text to remove stop words on.</param> | ||
/// <param name="catalog">The transform's catalog.</param> | ||
/// <param name="outputColumnName">Name of the column resulting from the transformation of <paramref name="inputColumnName"/>. | ||
/// This column's data type will be unknown size vector of text.</param> | ||
/// <param name="inputColumnName">Name of the column to copy the data from. | ||
/// This estimator operates over vector of text.</param> | ||
/// <param name="stopwords">Array of words to remove.</param> | ||
/// <example> | ||
/// <format type="text/markdown"> | ||
|
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.
nice. let's check how this renders when the preview site is refreshed tomorrow