{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# How to use the package in a notebook\n", "\n", "
\n", "\n", "
\n", "\n", "![Python Logo](../_static/images/python_logo.png)\n", "\n", "
\n", "\n", "### *nlpretext*\n", "\n", "
\n", "\n", "## Installing from the main branch\n", "\n", "To install the library from the main branch, you can run the following cell :" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "%pip install git+ssh://git@github.com/artefactory/NLPretext.git@main" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Installing from a specific release\n", "\n", "To install the library from a specific release, you can run the following cell :" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "%pip install git+ssh://git@github.com/artefactory/NLPretext.git@v1.0.5" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Using the package\n", "\n", "You can now import and run whatever is in the package :" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "from nlpretext.basic.preprocess import replace_emails\n", "\n", "example = \"I have forwarded this email to obama@whitehouse.gov\"\n", "example = replace_emails(example, replace_with=\"*EMAIL*\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "print(example)" ] } ], "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.9" } }, "nbformat": 4, "nbformat_minor": 1 }