Skip to content

Commit 566a092

Browse files
committed
Add Tensorflow.Text project.
1 parent 89f40e5 commit 566a092

File tree

17 files changed

+241
-5
lines changed

17 files changed

+241
-5
lines changed

TensorFlow.NET.sln

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tensorflow.Benchmark", "src
99
EndProject
1010
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tensorflow.UnitTest", "test\TensorFlowNET.UnitTest\Tensorflow.UnitTest.csproj", "{23C28035-2FCE-41F3-9A12-E73CE8A5AE32}"
1111
EndProject
12-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Console", "src\TensorFlowNET.Console\TensorFlowNET.Console.csproj", "{03F06299-3F4B-4449-A709-3A647657BC0C}"
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tensorflow.Console", "src\TensorFlowNET.Console\Tensorflow.Console.csproj", "{03F06299-3F4B-4449-A709-3A647657BC0C}"
1313
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tensorflow.Keras", "src\TensorFlowNET.Keras\Tensorflow.Keras.csproj", "{49D71826-C03D-4FA7-9BAC-22C1327E65CF}"
1515
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tensorflow.Text", "src\TensorFlowNET.Text\Tensorflow.Text.csproj", "{1AB8108D-4FFE-4A16-88E7-328EAF686370}"
17+
EndProject
1618
Global
1719
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1820
Debug|Any CPU = Debug|Any CPU
@@ -149,6 +151,30 @@ Global
149151
{49D71826-C03D-4FA7-9BAC-22C1327E65CF}.Release|x64.Build.0 = Release|x64
150152
{49D71826-C03D-4FA7-9BAC-22C1327E65CF}.Release|x86.ActiveCfg = Release|Any CPU
151153
{49D71826-C03D-4FA7-9BAC-22C1327E65CF}.Release|x86.Build.0 = Release|Any CPU
154+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
155+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Debug|Any CPU.Build.0 = Debug|Any CPU
156+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Debug|x64.ActiveCfg = Debug|Any CPU
157+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Debug|x64.Build.0 = Debug|Any CPU
158+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Debug|x86.ActiveCfg = Debug|Any CPU
159+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Debug|x86.Build.0 = Debug|Any CPU
160+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Debug-Minimal|Any CPU.ActiveCfg = Debug|Any CPU
161+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Debug-Minimal|Any CPU.Build.0 = Debug|Any CPU
162+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Debug-Minimal|x64.ActiveCfg = Debug|Any CPU
163+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Debug-Minimal|x64.Build.0 = Debug|Any CPU
164+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Debug-Minimal|x86.ActiveCfg = Debug|Any CPU
165+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Debug-Minimal|x86.Build.0 = Debug|Any CPU
166+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Publish|Any CPU.ActiveCfg = Debug|Any CPU
167+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Publish|Any CPU.Build.0 = Debug|Any CPU
168+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Publish|x64.ActiveCfg = Debug|Any CPU
169+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Publish|x64.Build.0 = Debug|Any CPU
170+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Publish|x86.ActiveCfg = Debug|Any CPU
171+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Publish|x86.Build.0 = Debug|Any CPU
172+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Release|Any CPU.ActiveCfg = Release|Any CPU
173+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Release|Any CPU.Build.0 = Release|Any CPU
174+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Release|x64.ActiveCfg = Release|Any CPU
175+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Release|x64.Build.0 = Release|Any CPU
176+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Release|x86.ActiveCfg = Release|Any CPU
177+
{1AB8108D-4FFE-4A16-88E7-328EAF686370}.Release|x86.Build.0 = Release|Any CPU
152178
EndGlobalSection
153179
GlobalSection(SolutionProperties) = preSolution
154180
HideSolutionNode = FALSE
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using static Tensorflow.Binding;
5+
using static Tensorflow.TextApi;
6+
7+
namespace Tensorflow
8+
{
9+
public class Exploring
10+
{
11+
public void Run()
12+
{
13+
var docs = tf.constant(new[] { "Everything not saved will be lost." });
14+
var tokenizer = text.WhitespaceTokenizer();
15+
text.wordshape(docs, Text.WordShape.HAS_TITLE_CASE);
16+
17+
throw new NotImplementedException("");
18+
}
19+
}
20+
}

src/TensorFlowNET.Console/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ class Program
66
{
77
static void Main(string[] args)
88
{
9+
// this class is used explor new features.
10+
var exploring = new Exploring();
11+
// exploring.Run();
12+
913
// boot .net core 10.5M.
1014
var mm = new MemoryMonitor();
1115
// warm up tensorflow.net 28.5M.

src/TensorFlowNET.Console/TensorFlowNET.Console.csproj renamed to src/TensorFlowNET.Console/Tensorflow.Console.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="2.3.0" />
11+
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="2.3.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>
1515
<ProjectReference Include="..\TensorFlowNET.Keras\Tensorflow.Keras.csproj" />
16+
<ProjectReference Include="..\TensorFlowNET.Text\Tensorflow.Text.csproj" />
1617
</ItemGroup>
1718

1819
</Project>

src/TensorFlowNET.Core/Tensorflow.Binding.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ TensorFlow .NET v0.30 is focused on making more Keras API work including:
8282
</ItemGroup>
8383

8484
<ItemGroup>
85-
<PackageReference Include="Google.Protobuf" Version="3.11.4" />
8685
<PackageReference Include="MethodBoundaryAspect.Fody" Version="2.0.138" />
8786
<PackageReference Include="NumSharp.Lite" Version="0.1.9" />
8887
<PackageReference Include="Protobuf.Text" Version="0.4.0" />
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Text
6+
{
7+
public enum Reduction
8+
{
9+
None,
10+
STRING_JOIN
11+
}
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Text
6+
{
7+
public enum WordShape
8+
{
9+
HAS_TITLE_CASE,
10+
IS_UPPERCASE,
11+
HAS_SOME_PUNCT_OR_SYMBOL,
12+
IS_NUMERIC_VALUE
13+
}
14+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Text
6+
{
7+
public partial class TextOps
8+
{
9+
public static Tensor ngrams(Tensor input, int width,
10+
int axis = -1,
11+
Reduction reduction_type = Reduction.None,
12+
string string_separator = " ",
13+
string name = null)
14+
=> throw new NotImplementedException("");
15+
}
16+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Text
6+
{
7+
public partial class TextOps
8+
{
9+
public static Tensor wordshape(Tensor input, WordShape pattern, string name = null)
10+
=> throw new NotImplementedException("");
11+
}
12+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<RootNamespace>Tensorflow.Text</RootNamespace>
6+
<AssemblyName>Tensorflow.Text</AssemblyName>
7+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
8+
<Version>0.0.1</Version>
9+
</PropertyGroup>
10+
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
12+
<DefineConstants>DEBUG;TRACE</DefineConstants>
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\TensorFlowNET.Core\Tensorflow.Binding.csproj" />
17+
</ItemGroup>
18+
19+
</Project>

0 commit comments

Comments
 (0)