Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

keras
/
bert_base_zh

Text Classification
KerasHub
Chinese
Model card Files Files and versions
xet
Community
1

Instructions to use keras/bert_base_zh with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • KerasHub

    How to use keras/bert_base_zh with KerasHub:

    import keras_hub
    
    # Load TextClassifier model
    text_classifier = keras_hub.models.TextClassifier.from_preset(
        "hf://keras/bert_base_zh",
        num_classes=2,
    )
    # Fine-tune
    text_classifier.fit(x=["Thilling adventure!", "Total snoozefest."], y=[1, 0])
    # Classify text
    text_classifier.predict(["Not my cup of tea."])
    
    import keras_hub
    
    # Create a MaskedLM model
    task = keras_hub.models.MaskedLM.from_preset("hf://keras/bert_base_zh")
    
    import keras_hub
    
    # Create a Backbone model unspecialized for any task
    backbone = keras_hub.models.Backbone.from_preset("hf://keras/bert_base_zh")
    
  • Keras

    How to use keras/bert_base_zh with Keras:

    # Available backend options are: "jax", "torch", "tensorflow".
    import os
    os.environ["KERAS_BACKEND"] = "jax"
    
    import keras
    
    model = keras.saving.load_model("hf://keras/bert_base_zh")
    
  • Notebooks
  • Google Colab
  • Kaggle
New discussion
Resources
  • PR & discussions documentation
  • Code of Conduct
  • Hub documentation

https://chatgpt.com/g/g-68328cd1e1cc8191ae255c061e5aa3b2-ide-ia-inteligencia-estrategica

1
#1 opened 11 months ago by
matversedao
Company
TOS Privacy About Careers
Website
Models Datasets Spaces Pricing Docs