Show / Hide Table of Contents

Class TextUtil

Inheritance
System.Object
Keras
Base
TextUtil
Implements
System.IDisposable
Inherited Members
Base.Parameters
Base.None
Base.Init()
Base.ToPython()
Base.InvokeStaticMethod(Object, String, Dictionary<String, Object>)
Base.InvokeMethod(String, Dictionary<String, Object>)
Base.Item[String]
Keras.Instance
Keras.keras
Keras.keras2onnx
Keras.tfjs
Keras.Dispose()
Keras.ToTuple(Array)
Keras.ToList(Array)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Keras.PreProcessing.Text
Assembly: Keras.dll
Syntax
public class TextUtil : Base, IDisposable

Methods

| Improve this Doc View Source

HashingTrick(String, Int32, String, String, Boolean, String)

Declaration
public static int[] HashingTrick(string text, int n, string hash_function = "", string filters = "!\"#$%&()*+,-./:;<=>?@[\\]^_`{|}~\t\n", bool lower = true, string split = " ")
Parameters
Type Name Description
System.String text
System.Int32 n
System.String hash_function
System.String filters
System.Boolean lower
System.String split
Returns
Type Description
System.Int32[]
| Improve this Doc View Source

OneHot(String, Int32, String, Boolean, String)

One-hot encodes a text into a list of word indexes of size n. This is a wrapper to the hashing_trick function using hash as the hashing function; unicity of word to index mapping non-guaranteed.

Declaration
public static int[, ] OneHot(string text, int n, string filters = "!\"#$%&()*+,-./:;<=>?@[\\]^_`{|}~\t\n", bool lower = true, string split = " ")
Parameters
Type Name Description
System.String text

The text.

System.Int32 n

The n.

System.String filters

The filters.

System.Boolean lower

if set to true [lower].

System.String split

The split.

Returns
Type Description
System.Int32[,]
| Improve this Doc View Source

TextToWordSequence(String, String, Boolean, String)

Texts to word sequence.

Declaration
public static string[] TextToWordSequence(string text, string filters = "!\"#$%&()*+,-./:;<=>?@[\\]^_`{|}~\t\n", bool lower = true, string split = " ")
Parameters
Type Name Description
System.String text

The text.

System.String filters

The filters.

System.Boolean lower

if set to true [lower].

System.String split

The split.

Returns
Type Description
System.String[]

Implements

System.IDisposable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX