introduction_en.ipynb 4.0 KB
Notebook
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "d6793868",
   "metadata": {},
   "source": [
    "# IndoBERT Base Model (phase1 - uncased)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "48b35590",
   "metadata": {},
   "source": [
    "[IndoBERT](https://arxiv.org/abs/2009.05387) is a state-of-the-art language model for Indonesian based on the BERT model. The pretrained model is trained using a masked language modeling (MLM) objective and next sentence prediction (NSP) objective.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e5dc323c",
   "metadata": {},
   "source": [
    "## All Pre-trained Models\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7db5d6e5",
   "metadata": {},
   "source": [
    "| Model                          | #params                        | Arch. | Training data                     |\n",
    "|--------------------------------|--------------------------------|-------|-----------------------------------|\n",
    "| `indobenchmark/indobert-base-p1` | 124.5M   | Base  | Indo4B (23.43 GB of text)            |\n",
    "| `indobenchmark/indobert-base-p2` | 124.5M   | Base  | Indo4B (23.43 GB of text)            |\n",
    "| `indobenchmark/indobert-large-p1` | 335.2M   | Large  | Indo4B (23.43 GB of text)            |\n",
    "| `indobenchmark/indobert-large-p2` | 335.2M   | Large  | Indo4B (23.43 GB of text)            |\n",
    "| `indobenchmark/indobert-lite-base-p1` | 11.7M   | Base  | Indo4B (23.43 GB of text)            |\n",
    "| `indobenchmark/indobert-lite-base-p2` | 11.7M   | Base  | Indo4B (23.43 GB of text)            |\n",
    "| `indobenchmark/indobert-lite-large-p1` | 17.7M   | Large  | Indo4B (23.43 GB of text)            |\n",
    "| `indobenchmark/indobert-lite-large-p2` | 17.7M   | Large  | Indo4B (23.43 GB of text)            |\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fc8827fd",
   "metadata": {},
   "source": [
    "## How to use\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e5b6e205",
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install --upgrade paddlenlp"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6701163d",
   "metadata": {},
   "outputs": [],
   "source": [
    "import paddle\n",
    "from paddlenlp.transformers import AutoModel\n",
    "\n",
    "model = AutoModel.from_pretrained(\"indobenchmark/indobert-base-p1\")\n",
    "input_ids = paddle.randint(100, 200, shape=[1, 20])\n",
    "print(model(input_ids))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fb28cf5b",
   "metadata": {},
   "source": [
    "## Citation\n",
    "\n",
    "```\n",
    "@inproceedings{wilie2020indonlu,\n",
    "title={IndoNLU: Benchmark and Resources for Evaluating Indonesian Natural Language Understanding},\n",
    "author={Bryan Wilie and Karissa Vincentio and Genta Indra Winata and Samuel Cahyawijaya and X. Li and Zhi Yuan Lim and S. Soleman and R. Mahendra and Pascale Fung and Syafri Bahar and A. Purwarianti},\n",
    "booktitle={Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing},\n",
    "year={2020}\n",
    "}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e155d1ce",
   "metadata": {},
   "source": [
    "> The model introduction and model weights originate from [https://huggingface.co/indobenchmark/indobert-base-p1](https://huggingface.co/indobenchmark/indobert-base-p1) and were converted to PaddlePaddle format for ease of use in PaddleNLP.\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}