diff --git a/data/imdb.zip b/data/imdb.zip new file mode 100644 index 00000000..7083413c Binary files /dev/null and b/data/imdb.zip differ diff --git a/test/TensorFlowNET.Examples/TensorFlowNET.Examples.csproj b/test/TensorFlowNET.Examples/TensorFlowNET.Examples.csproj index c5a0f729..8667d4c2 100644 --- a/test/TensorFlowNET.Examples/TensorFlowNET.Examples.csproj +++ b/test/TensorFlowNET.Examples/TensorFlowNET.Examples.csproj @@ -7,7 +7,7 @@ - + diff --git a/test/TensorFlowNET.Examples/TextClassificationWithMovieReviews.cs b/test/TensorFlowNET.Examples/TextClassificationWithMovieReviews.cs new file mode 100644 index 00000000..7900d06b --- /dev/null +++ b/test/TensorFlowNET.Examples/TextClassificationWithMovieReviews.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Tensorflow; + +namespace TensorFlowNET.Examples +{ + public class TextClassificationWithMovieReviews : Python, IExample + { + string dir = "text_classification_with_movie_reviews"; + + public void Run() + { + PrepareData(); + } + + private void PrepareData() + { + + Directory.CreateDirectory(dir); + + // get model file + string url = "https://storage.googleapis.com/download.tensorflow.org/models/inception_v3_2016_08_28_frozen.pb.tar.gz"; + + string zipFile = Path.Join(dir, $"imdb.zip"); + Utility.Web.Download(url, zipFile); + + if (!File.Exists(Path.Join(dir, zipFile))) + Utility.Compress.ExtractTGZ(zipFile, dir); + } + } +} diff --git a/test/TensorFlowNET.Examples/python/basic_text_classification.py b/test/TensorFlowNET.Examples/python/text_classification_with_movie_reviews.py similarity index 100% rename from test/TensorFlowNET.Examples/python/basic_text_classification.py rename to test/TensorFlowNET.Examples/python/text_classification_with_movie_reviews.py diff --git a/test/TensorFlowNET.UnitTest/TensorFlowNET.UnitTest.csproj b/test/TensorFlowNET.UnitTest/TensorFlowNET.UnitTest.csproj index 925b05fd..19bd6b44 100644 --- a/test/TensorFlowNET.UnitTest/TensorFlowNET.UnitTest.csproj +++ b/test/TensorFlowNET.UnitTest/TensorFlowNET.UnitTest.csproj @@ -20,7 +20,7 @@ - +