forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextInterface.cs
More file actions
37 lines (34 loc) · 1.22 KB
/
TextInterface.cs
File metadata and controls
37 lines (34 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Text;
using Tensorflow.Text.Tokenizers;
namespace Tensorflow.Text
{
public class TextInterface
{
public ITokenizer WhitespaceTokenizer()
=> new WhitespaceTokenizer();
public Tensor wordshape(Tensor input, WordShape pattern, string name = null)
=> TextOps.wordshape(input, pattern, name: name);
/// <summary>
/// Create a tensor of n-grams based on the input data `data`.
/// </summary>
/// <param name="input"></param>
/// <param name="width"></param>
/// <param name="axis"></param>
/// <param name="reduction_type"></param>
/// <param name="string_separator"></param>
/// <param name="name"></param>
/// <returns></returns>
public static Tensor ngrams(Tensor input, int width,
int axis = -1,
Reduction reduction_type = Reduction.None,
string string_separator = " ",
string name = null)
=> TextOps.ngrams(input, width,
axis: axis,
reduction_type: reduction_type,
string_separator: string_separator,
name: name);
}
}