Skip to content

dlabsai/tfx-sentiment-analysis

Repository files navigation

tfx-sentiment-analysis

End-to-end TFX pipeline for sentiment analysis

More info

Link to article describing creation of this TFX pipeline for sentiment analysis: https://dlabs.ai/resources/courses/bert-sentiment-analysis-on-vertex-ai-using-tfx/

Technical details

  • E2E TFX pipeline from CSV file to serving endpoint,
  • runs locally and on Vertex AI,
  • uses TFX helper library,
  • uses BERT preprocessor and BERT encoder from Tensorflow Hub,
  • 100% containerized (no local dependencies required).

Build

Adjust the location of your image in Makefile (IMAGE variable).

Use

make build

to build the container image.

Use

make push

to push the built image to external repository.

Running locally:

  1. Setup your input dataset.

  2. Adjust your settings in local_runner.py and Makefile.

  3. Build and push updated image.

  4. To start a local pipeline run execute:

    make local_pipeline
  5. After a model is trained you can serve it through

    make serve
  6. When the serving server is running you can execute a sample query through

    make query

Running on Vertex AI

  1. Setup you Google Cloud Platform project (see article mentioned in More info section).

  2. Setup your input dataset.

  3. Adjust your setting in vertex_ai_runner.py and Makefile.

  4. Build and push updated image.

  5. To schedule a pipeline run on Vertex AI execute:

    make vertex_ai_pipeline

About

TFX pipeline for sentiment analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages