How to paraphrase text in Python using the PARROT library (Ft. @KenJee_ds)
Key Takeaways
The video demonstrates how to use the PARROT library in Python to paraphrase text, utilizing a pre-trained model based on the T5 architecture. The tutorial covers installation, importing the library, and generating paraphrases for various input phrases.
Full Transcript
in this video i'm going to show you how you could paraphrase text in python using the parrot library and so we're starting right now and so the jupiter notebook used in this tutorial will be provided in the video description and it's going to be on the github of the data professor and so the first thing that you need to do here is to install the parrot library and it's developed by pre tv rod dowmo darin all right and now it's installed and we're going to import the parrot function from parrot and here we're going to use pytorch let's run the first cell here and then for reproducibility we're going to fix the random state number here but you could feel free to try out a different random seed number and then we're gonna initialize the model here and it's downloading the model and this one is based on the t5 and let me check out the runtime is it gpu no i haven't selected the gpu let's see if this works one moment as this being installed or downloaded so the pre-trained model here is being downloaded and the great thing is that you don't have to train the model you're just downloading the model and then you're using it and so the phrase here that we're gonna use today i've arbitrarily created this and so let's check out whether this particular parrot model will perform good or not let's have a look alright it's finished and let's read in the phrase here and actually here you can put in several sentences if you want let me add another one so i'm gonna use two phrases what is the best way to learn data science and how can i become a data scientist let's see if the model will generate some interesting results for us and the original one was what is the best way to learn data science and the output here is how do i learn data science how can i learn data science where should i learn data science where should i start learning data science show the best ways to learn data science tell me the best way to learn data science okay so i'm not sure why it's not displaying the result for the second one so let me just delete the first one then let's do it again so here the input is how can i become a data scientist and the output is tell me the best way to become a data scientist how do you become a data scientist can someone become a data scientist how do i become a data scientist how can one become a data scientist how can i become a data scientist okay so it's reasonably okay for the paraphrasing and so let's make it a bit more general where can i buy the best the most delicious pizzas let's try that all right and so the output is where can i get all the best pizza where can i buy good quality pizzas where can i get the best quality pizza where can i buy the best pizzas where can i get delicious pizza where can i get some delicious pizza where can i find the most delicious pizza and where can i buy most delicious pizza okay so it's reasonably good for paraphrasing less technical sentences how about this question and so let's get some possible spin to the question here so the input is what's the most delicious papayas and so here it is giving us four results what's the best papaya to eat which are the best papayas what is your most delicious papaya lists the most delicious papayas and so if you would like to find the answer to this one it has to come from kanji there's a lot of different types of papaya so right i i actually only like the whole hawaii gold papaya i don't like the mexican red papaya very much it tastes kind of funky to me but for anyone that's a papaya daughter you have to try the hawaii gold very all right all right yes and so if you're finding value in this video please smash the like button to support the channel subscribe if you haven't already and also hit on the notification bell so that you will be notified of the next video and as always the best way to learn data science is to do data science and please enjoy the journey
Original Description
In this video, I will show you how to use the PARROT library to paraphrase text in Python. Essentially PARROT is a pre-trained paraphrase based utterance augmentation framework. In just a few lines of code, you will be able to automatically perform text paraphrasing with ease.
🌟 Download Kite for FREE https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=dataprofessor&utm_content=description-only
🌟 Subscribe to Ken Jee https://www.youtube.com/channel/UCiT9RITQ9PW6BhXK0y2jaeg
⭕ Links for this video
- Code https://github.com/dataprofessor/parrot
- Parrot GitHub https://github.com/PrithivirajDamodaran/Parrot
- Install pip install git+https://github.com/PrithivirajDamodaran/Parrot.git
Note: Code used in this video was adapted from Parrot creator Prithiviraj Damodaran
⭕ Support my work:
🌟 Subscribe to the Coding Professor channel https://www.youtube.com/channel/UCJzlfIoF8nmWqJIv_iWQVRw?sub_confirmation=1
🌟 Subscribe to the Data Professor https://www.youtube.com/dataprofessor?sub_confirmation=1
🌟 Join the Newsletter of Data Professor http://newsletter.dataprofessor.org
🌟 Buy me a coffee https://www.buymeacoffee.com/dataprofessor
⭕ Recommended Books:
🌟https://kit.co/dataprofessor
✅ Python Basics: A Practical Introduction to Python 3 https://amzn.to/3awdWgm
✅ Learn Python Programming (The no-nonsense, beginner's guide) https://amzn.to/2RFpSpn
✅ Learn to Program with Minecraft https://amzn.to/3x2MujZ
✅ Automate the Boring Stuff with Python, 2nd Edition: Practical Programming for Total Beginners https://amzn.to/2QzkyDs
⭕ Disclaimer:
Recommended books and tools are affiliate links that gives me a portion of sales at no cost to you, which will contribute to the improvement of this channel's contents.
⭕ Stock photos, graphics and videos used on this channel:
✅ https://1.envato.market/c/2346717/628379/4662
#python #parrot #paraphrase #paraphrasing #pythontutorial #dataprofessor
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Data Professor · Data Professor · 0 of 60
← Previous
Next →
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
How a Biologist became a Data Scientist
Data Professor
WEKA Tutorial #1.1 - How to Build a Data Mining Model from Scratch
Data Professor
WEKA Tutorial #1.2 - How to Build a Data Mining Model from Scratch
Data Professor
WEKA Tutorial #1.3 - How to Build a Data Mining Model from Scratch
Data Professor
Computational Drug Discovery: Machine Learning for Making Sense of Big Data in Drug Discovery
Data Professor
Quotes #1 on Big Data and Data Science
Data Professor
Quotes #2 on Big Data and Data Science
Data Professor
Quotes #3 on Big Data and Data Science
Data Professor
Quotes #4 on Big Data and Data Science
Data Professor
Quotes #5 on Big Data and Data Science
Data Professor
Data Science 101: Starting a Data Science / Data Mining Project
Data Professor
Data Science 101: CRISP-DM - Data Mining / Data Science in 6 Steps
Data Professor
R Programming 101: How to Define Variables
Data Professor
R Programming 101: Read and Write CSV files
Data Professor
Data Science 101: Basic Command-Line for Data Science
Data Professor
Strategies for Learning Data Science in 2020 (Data Science 101)
Data Professor
Building your Data Science Portfolio with GitHub (Data Science 101)
Data Professor
R Programming 101: Setting up R programming environment (R, RStudio and RStudio.cloud)
Data Professor
Exploratory Data Analysis in R: Towards Data Understanding
Data Professor
Exploratory Data Analysis in R: Quick Dive into Data Visualization
Data Professor
Machine Learning in R: Building a Classification Model
Data Professor
Machine Learning in R: Repurpose Machine Learning Code for New Data
Data Professor
Data Science 101: Deploying your Machine Learning Model
Data Professor
Machine Learning in R: Deploy Machine Learning Model using RDS
Data Professor
Data Pre-processing in R: Handling Missing Data
Data Professor
Machine Learning in R: Speed up Model Building with Parallel Computing
Data Professor
Data Science 101: Overview of Machine Learning Model Building Process
Data Professor
Web Apps in R: Building your First Web Application in R | Shiny Tutorial Ep 1
Data Professor
Web Apps in R: Build Interactive Histogram Web Application in R | Shiny Tutorial Ep 2
Data Professor
Web Apps in R: Building Data-Driven Web Application in R | Shiny Tutorial Ep 3
Data Professor
Web Apps in R: Building the Machine Learning Web Application in R | Shiny Tutorial Ep 4
Data Professor
Web Apps in R: Build BMI Calculator web application in R for health monitoring | Shiny Tutorial Ep 5
Data Professor
Machine Learning in R: Building a Linear Regression Model
Data Professor
What programming language to learn for Data Science? R versus Python
Data Professor
How to Become a Data Scientist (Learning Path and Skill Sets Needed)
Data Professor
Using Python in R
Data Professor
Interpretable Machine Learning Models
Data Professor
Making Scatter Plots in R [Data Visualisation in R series]
Data Professor
Machine Learning in Python: Building a Classification Model
Data Professor
Compare Machine Learning Classifiers in Python
Data Professor
Hyperparameter Tuning of Machine Learning Model in Python
Data Professor
Practical Introduction to Google Colab for Data Science
Data Professor
File Handling in Google Colab for Data Science
Data Professor
Pandas for Data Science: Create and Combine DataFrames / Rename Columns
Data Professor
Machine Learning in Python: Building a Linear Regression Model
Data Professor
Machine Learning in Python: Principal Component Analysis (PCA) for Handling High-Dimensional Data
Data Professor
How to Plot an ROC Curve in Python | Machine Learning in Python
Data Professor
Installing conda on Google Colab for Data Science
Data Professor
Use native R on Google Colab for Data Science
Data Professor
How to Save and Download files from Google Colab
Data Professor
Easy Web Scraping in Python using Pandas for Data Science
Data Professor
Data Science for Computational Drug Discovery using Python (Part 1)
Data Professor
Pandas Profiling for Data Science (Quick and Easy Exploratory Data Analysis)
Data Professor
Exploratory Data Analysis in Python using pandas
Data Professor
Quick tour of PyCaret (a low-code machine learning library in Python)
Data Professor
How to Upload Files to Google Colab
Data Professor
How to Install and Use Pandas Profiling on Google Colab
Data Professor
How to Adjust the Style of Pandas DataFrame
Data Professor
How to use Bamboolib for Data Wrangling in Data Science
Data Professor
How to use Pandas Profiling on Kaggle
Data Professor
Related Reads
📰
📰
📰
📰
Claude HUD: Adding a Terminal Heads-Up Display to Claude Code
Dev.to AI
AI Resume Generator That Gets Shortlisted
Dev.to · Amrendra N Mishra
AI Is Changing What Software Is Worth Building
Dev.to · Kshitij Chaudhary
I Edited One Photo with AI — Instagram Immediately Flagged It. Here’s What’s Really Happening
Medium · AI
🎓
Tutor Explanation
DeepCamp AI