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
File size: 543 Bytes
ee03b1a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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
|