Cara panggampangna pikeun ngimpor modél basa BERT kana Python pikeun dianggo sareng PyTorch nyaéta nganggo perpustakaan Hugging Face Transformer, anu parantos ngawangun dina metode pikeun pra-latihan, inferensi, sareng nyebarkeun BERT. ``` ti transformator ngimpor AutoTokenizer, BertModel ngimpor torch tokenizer = AutoTokenizer.from_pre-trained("bert-base-uncleared") model = BertModel.from_pre-trained"bert-base-uncleared") inputs = tokenizer "(Hello, anjing abdi lucu", return_tensors="pt") output = model**input) last_hidden_states = output.last_hidden_state ```
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence