Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

keras
/
bert_tiny_en_uncased_sst2

Text Classification
KerasHub
English
Model card Files Files and versions
xet
Community

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

  • Libraries
  • KerasHub

    How to use keras/bert_tiny_en_uncased_sst2 with KerasHub:

    import keras_hub
    
    # Load TextClassifier model
    text_classifier = keras_hub.models.TextClassifier.from_preset(
        "hf://keras/bert_tiny_en_uncased_sst2",
        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_tiny_en_uncased_sst2")
    
    import keras_hub
    
    # Create a Backbone model unspecialized for any task
    backbone = keras_hub.models.Backbone.from_preset("hf://keras/bert_tiny_en_uncased_sst2")
    
  • Keras

    How to use keras/bert_tiny_en_uncased_sst2 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_tiny_en_uncased_sst2")
    
  • Notebooks
  • Google Colab
  • Kaggle
bert_tiny_en_uncased_sst2
1.52 kB
Ctrl+K
Ctrl+K
  • 3 contributors
History: 1 commit
Divyasreepat's picture
Divyasreepat
initial commit
ab3bc62 verified almost 2 years ago
  • .gitattributes
    1.52 kB
    initial commit almost 2 years ago