FsBERTTokenizer 1.0.0

dotnet add package FsBERTTokenizer --version 1.0.0
NuGet\Install-Package FsBERTTokenizer -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FsBERTTokenizer" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FsBERTTokenizer --version 1.0.0
#r "nuget: FsBERTTokenizer, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FsBERTTokenizer as a Cake Addin
#addin nuget:?package=FsBERTTokenizer&version=1.0.0

// Install FsBERTTokenizer as a Cake Tool
#tool nuget:?package=FsBERTTokenizer&version=1.0.0

BERTTokenizer

A helper library to split a string into tokens suitable for consumption by BERT-based models. BERT requires that some words be split furhter into smaller tokens called 'word pieces'.

Tokenization requires a vocabluary dictionary. The standard text BERT vocabulary file can be loaded using the following helper function:

let vocab = BERTTokenizer.Vocabulary.loadFromFile vocabFile

The simplest way to use the tokenizer is as follows:

let sampleText = """Unos has been around for ever, & I feel like this restaurant chain peak in popularity..."""

let contextText = ""

let vocab = BERTTokenizer.Vocabulary.loadFromFile <path>
let toLowerCase = true //for 'uncased' BERT models
let maxSeqLen   = 512

let ftrs = BERTTokenizer.Featurizer.toFeatures vocab toLowerCase maxSeqLen sampleText contextText

BERT Tokenizer takes two strings. Internally it will join the two strings with a separator in between and return the token sequence. This format is used for question/answer type tasks. The second string can be empty for other tasks such as text classification.

The returned 'ftrs' record contains token data, e.g token id, separator type ids, mask, etc. The data from this record can be converted to tensors for model consumption

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 887 11/19/2021