Skip to content

Created sample for 'TokenizeIntoCharactersAsKeys' API. #3123

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

Merged
merged 4 commits into from
Mar 28, 2019

Conversation

zeahmed
Copy link
Contributor

@zeahmed zeahmed commented Mar 27, 2019

Related to #1209.

// Expected output:
// Number of tokens: 112
// Character Tokens: M,L,.,N,E,T,',s,<?>,T,o,k,e,n,i,z,e,I,n,t,o,C,h,a,r,a,c,t,e,r,s,A,s,K,e,y,s,<?>,A,P,I,<?>,
// s,p,l,i,t,s,<?>,t,e,x,t,/,s,t,r,i,n,g,<?>,i,n,t,o,<?>,c,h,a,r,a,c,t,e,r,s,.
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Mar 28, 2019

Choose a reason for hiding this comment

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

[](start = 73, length = 3)

do we really present space as <?> ? #Resolved

Copy link
Contributor Author

@zeahmed zeahmed Mar 28, 2019

Choose a reason for hiding this comment

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

Its a unit separator special character.

private const ushort UnitSeparator = 0x1f;
#Resolved

Copy link
Contributor Author

@zeahmed zeahmed Mar 28, 2019

Choose a reason for hiding this comment

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

sorry! this is the control character used instead of spaces. Please disregard my previous comments

#Resolved

Copy link
Contributor

Choose a reason for hiding this comment

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

would be nice to left some comment about that.


In reply to: 270190306 [](ancestors = 270190306)


namespace Microsoft.ML.Samples.Dynamic
{
public static class TokenizeIntoCharacters
Copy link

@shmoradims shmoradims Mar 28, 2019

Choose a reason for hiding this comment

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

TokenizeIntoCharacters [](start = 24, length = 22)

let's name the file and class the same as the api. please make sure to update the name in the xml reference when you rename #Resolved

// Create an empty data sample list. The 'TokenizeIntoCharactersAsKeys' does not require training data as
// the estimator ('TokenizingByCharactersEstimator') created by 'TokenizeIntoCharactersAsKeys' API is not a trainable estimator.
// The empty list is only needed to pass input schema to the pipeline.
var samples = new List<TextData>();
Copy link

@shmoradims shmoradims Mar 28, 2019

Choose a reason for hiding this comment

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

samples [](start = 16, length = 7)

let's call this emptySamples to complement the comments above #Resolved

var samples = new List<TextData>();

// Convert sample list to an empty IDataView.
var dataview = mlContext.Data.LoadFromEnumerable(samples);
Copy link

@shmoradims shmoradims Mar 28, 2019

Choose a reason for hiding this comment

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

dataview [](start = 16, length = 8)

also emptyDataview #Resolved

Copy link

@shmoradims shmoradims left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka left a comment

Choose a reason for hiding this comment

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

:shipit:

@codecov
Copy link

codecov bot commented Mar 28, 2019

Codecov Report

Merging #3123 into master will decrease coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3123      +/-   ##
==========================================
- Coverage   72.52%   72.51%   -0.01%     
==========================================
  Files         808      808              
  Lines      144665   144665              
  Branches    16198    16198              
==========================================
- Hits       104913   104903      -10     
- Misses      35342    35349       +7     
- Partials     4410     4413       +3
Flag Coverage Δ
#Debug 72.51% <ø> (-0.01%) ⬇️
#production 68.11% <ø> (-0.01%) ⬇️
#test 88.81% <ø> (ø) ⬆️
Impacted Files Coverage Δ
src/Microsoft.ML.Transforms/Text/TextCatalog.cs 41.66% <ø> (ø) ⬆️
...c/Microsoft.ML.FastTree/Utils/ThreadTaskManager.cs 79.48% <0%> (-20.52%) ⬇️
...StandardTrainers/Standard/LinearModelParameters.cs 60.05% <0%> (-0.27%) ⬇️
...ML.Transforms/Text/StopWordsRemovingTransformer.cs 86.1% <0%> (-0.16%) ⬇️
...oft.ML.StandardTrainers/StandardTrainersCatalog.cs 89.07% <0%> (ø) ⬆️

@zeahmed zeahmed merged commit ee5fbe0 into dotnet:master Mar 28, 2019
@zeahmed
Copy link
Contributor Author

zeahmed commented Mar 28, 2019

Thanks!

zeahmed added a commit to zeahmed/machinelearning that referenced this pull request Apr 8, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants