Instructions to use danhtran2mind/En2Vi-Translation-Transformer-TensorFlow with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use danhtran2mind/En2Vi-Translation-Transformer-TensorFlow with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://danhtran2mind/En2Vi-Translation-Transformer-TensorFlow") - Notebooks
- Google Colab
- Kaggle
| import string | |
| def input_processing(in_string): | |
| punct_marks = string.punctuation | |
| for mark in punct_marks: | |
| if mark in in_string: | |
| in_string = in_string.replace(mark, " " + mark) | |
| in_string = in_string.replace("scholl", "school") | |
| in_string = in_string.strip() | |
| return in_string | |
| def output_processing(in_string): | |
| in_string = in_string.replace("_", " ").replace('<sos>', '').replace('<eos>', '').strip() | |
| in_string = in_string[0].upper() + in_string[1:] | |
| return in_string | |