{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Installation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Using PIP" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Simply use PIP to install malaya,\n", "\n", "```bash\n", "pip3 install malaya\n", "```\n", "\n", "It will automatically all dependencies except for Tensorflow and PyTorch. So you can choose your own Tensorflow CPU / GPU version and PyTorch CPU / GPU version.\n", "\n", "Make sure **Tensorflow >= 1.15.0**, and **PyTorch >= 1.10**." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Getting started" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import malaya" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If no error or warning, you are good to go!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Simple sentiment analysis" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "model = malaya.sentiment.transformer(model = 'tiny-albert')" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "model.predict_words('Dia ni dlm pemerhatian kita,,,bole dkatakn \"gertak kuat\",,,bhsa utra kta \"gempaq kuat\",', bins_size = 0.01)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7" }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 4 }