{
  "source_file": "0930",
  "source_platform": "Medium",
  "author": "Chua Chin Hon",
  "title_listed": "\"Chain-linking\" NLP tasks With Wav2Vec2 & Transformers",
  "keywords": "",
  "domain": "文本处理",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://towardsdatascience.com/chain-linking-nlp-tasks-with-wav2vec2-transformers-7297181db3a7/",
  "publish_date": "2021-03-19",
  "corpus_stage": "",
  "notes": "",
  "id": "bb2fb6fad5b2",
  "collected_at": "2026-10-02T09:35:05",
  "title": "\"Chain-linking\" NLP tasks With Wav2Vec2 & Transformers | Towards Data Science",
  "body_markdown": "![Revisit consent button](../images/body-df29beacd7496220cc94.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](../images/body-2159bb67f3de8ad870eb.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Data Science](https://towardsdatascience.com/category/data-science/)\n# \"Chain-linking\" NLP tasks With Wav2Vec2 & Transformers\nGoing straight from audio to a range of text-based NLP tasks such as translation, summarisation and sentiment analysis.\n[Chua Chin Hon](https://towardsdatascience.com/author/chuachinhon/)\nMarch 19, 20216 min read\n### Going straight from audio to a range of text-based NLP tasks such as translation, summarisation and sentiment analysis\n![Chart: Chua Chin Hon](../images/003.png)\nChart: Chua Chin Hon\nThe addition of the [Wav2Vec2](https://huggingface.co/transformers/model_doc/wav2vec2.html) model in Hugging Face's transformers library has been one of the more exciting developments in NLP in recent months. Until then, it wasn't easy to execute tasks like machine translation or sentiment analysis if you only had a long audio clip to work with.\nBut now you can link up an interesting combination of NLP tasks in one go: transcribe the audio clip with Wav2Vec2, and then use a variety of transformer models to summarize or translate the transcript. The possible permutations and combinations of NLP tasks that you can link up is pretty mind boggling.\nResults could be patchy, of course. Some NLP tasks, such as summarisation, are very hard to crack by nature.\nThis post, a follow-up to my [earlier one on Wav2Vec2 trials](https://towardsdatascience.com/transcribing-poetry-and-speeches-with-wav2vec2-2658c6510f06), will outline 2 trials:\nLearn this step by step with the interactive [AI and Data Scientist](https://roadmap.sh/ai-data-scientist) and [Machine Learning](https://roadmap.sh/machine-learning) roadmaps.\n  * **#1: Speech-to-text-to-translation & sentiment analysis**\n  * **#2: Speech-to-text-to-summarisation**\n\n\n* * *\n## REPO, REQUIREMENTS, AND REFERENCES\nThe notebooks and audio files needed for the trials are in my [repo](https://github.com/chuachinhon/wav2vec2_transformers). Additionally, you'll need these to run the notebooks:\n  * [Transformers ≥ 4.3](https://pypi.org/project/transformers/)\n  * [Librosa](https://pypi.org/project/librosa/) (to manage the audio files)\n\n\nThe code in most of the notebooks have been updated to use a better approach for transcribing long audio files, via a post on Github by [Hugging Face's machine learning engineer Lysandre Jik](https://github.com/huggingface/transformers/issues/10366).\nIn my earlier work-around, I used [Audacity](https://www.audacityteam.org/) to manually split up long audio clips into smaller, more manageable pieces (audio clips longer than ~90s tend to crash local machines and Colab). Lysandre's code eliminates this step by using Librosa to stream in the long audio clip in shorter, fixed \"chunks\".\nThere are several versions of the Wav2Vec2 model on Hugging Face's model hub. For this post, I'll be using the [wav2vec2-large-960h-lv60-self](https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self) model.\n* * *\n## TRIAL #1: TRANSCRIBE + TRANSLATE + SENTIMENT ANALYSIS\n![Screen-grab on right via CNBC Television&#039;s YouTube channel](../images/001.png)\nScreen-grab on right via [CNBC Television's YouTube](https://www.youtube.com/watch?v=sZBquj94CGU) channel\nFor this trial, I opted for US President Joe Biden's [first prime time speech](https://www.youtube.com/watch?v=JYBatFW-BP4) on Mar 11/12 2021 (depending on which time zone you are in).\nHis speech was about 24 minutes long, and I streamed it to Wav2Vec2 via 25-second chunks. You can opt for longer or shorter chunks. I found 25s to give decent results. Details are in [notebook3.0](https://github.com/chuachinhon/wav2vec2_transformers/blob/main/notebooks/3.0_transcribe_translate_sentiment_analysis.ipynb) in my repo, and I won't repeat them here.\nThe speech is complex and [Biden is known to be fighting a stutter](https://www.theatlantic.com/magazine/archive/2020/01/joe-biden-stutter-profile/602401/). The transcript (download directly [here](https://www.dropbox.com/s/aybqx2jex5cg202/biden_alt.txt?dl=0)) is pretty rough in some parts, especially towards the end:\n![Download raw Wav2Vec2 transcript here](../images/002.png)\nDownload raw Wav2Vec2 transcript [here](https://www.dropbox.com/s/aybqx2jex5cg202/biden_alt.txt?dl=0)\nTo be fair, Biden spoke pretty clearly in my view, and this is an example where the Wav2Vec2 model struggled. But the model took just 12 minutes or so on my late-2015 iMac to produce the transcript, which is way, way faster than if I were to do it manually.\nNext, I wanted to pipe the transcript of Biden's speech to a machine translation model and see what the quality is like for a Chinese translation. I used [Hugging Face's implementation of MarianMT](https://huggingface.co/transformers/model_doc/marian.html) for this, as I've tried it on a few speeches [previously](https://github.com/chuachinhon/practical_nlp/blob/master/notebooks/4.0_english_to_chinese_translate.ipynb).\nThe results are borderline unusable, unfortunately. Download the full Chinese translation [here](https://www.dropbox.com/s/lricsuk8xw3ry8d/biden_translated_alt.txt?dl=0):\n![](../images/body-b301dad38248da114de4.png)\nThe \"chain-linking\" process works well from a technical perspective, and you just need about 10 additional lines of code after the Wav2Vec2 process.\nBut the quality of the translation clearly suffers when the problematic parts of the raw transcript were fed to the MarianMT model without a thorough clean up of the missing or wrong words, and proper punctuation. I added full stops (\".\") at the end of each 25s-worth of text transcript from Wav2Vec2, but that clearly doesn't capture the correct start and end of each sentence in the original speech.\nSo while it seems that \"chain-linking\" the NLP tasks would save a lot of time, the problems in one area can and will compound, resulting in lower quality results for tasks that are further downstream.\nClearly it will take additional time to clean up the raw English transcript. But I believe doing so would improve the quality of the Chinese translation considerably. As for accurate punctuation, there is no quick way to do it within Wav2Vec2 right now. But I suspect future versions of the model would resolve this issue, seeing that a number of auto-speech-recognition services on the market already have the \"add punctuation\" feature.\nNext, I wanted to try applying sentiment analysis to Biden's speech. The combination of speech-to-text with sentiment analysis can be really useful in political or business settings, where a quick understanding of the speaker's sentiment can affect certain decisions.\nThe raw transcript was turned into a simple data-frame, and I then used Hugging Face's transformers pipeline and Plotly to generate a \"sentiment-structure\" chart like the one below. I have been experimenting with these sentiment charts for a while. My earlier experiments can be found [here](https://github.com/chuachinhon/practical_nlp/blob/master/notebooks/1.0_speech_sentiment_cch.ipynb).\n![](../images/003.png)\nThis worked better than the attempt at Chinese translation, though I'm sure the sentiment analysis would also benefit from a thorough clean up and the inclusion of proper punctuation in the raw English transcript.\nThere's technically no reason why one would stop at just 3 tasks. You can easily write a few more lines of code and include summarisation as the 4th NLP task in a row.\nBut auto-summarisation of long text documents, including speeches, remain a highly challenging task even for transformer models. The results aren't ready for prime-time, in my view. Let's take a closer look in the next trial.\n## TRIAL #2: TRANSCRIBE + SUMMARISE\n![Screen-grab via the YouTube channel of the Singapore Prime Minister&#039;s Office.](../images/004.png)\nScreen-grab via the [YouTube channel of the Singapore Prime Minister's Office](https://www.youtube.com/watch?v=4bUl9R2N90A).\nFor this I picked a shorter audio clip, a 4-minute video of [Singapore Prime Minister Lee Hsien Loong responding to a question on populism](https://www.youtube.com/watch?v=4bUl9R2N90A) at a business conference in 2019. The clip focuses on a singular issue, but has enough complexity for it to be challenging for any auto-summarisation model.\nSee [notebook3.1](https://github.com/chuachinhon/wav2vec2_transformers/blob/main/notebooks/3.1_transcribe_summarise.ipynb) in my repo for details.\nThe Wav2Vec2 output is excellent, as you can see below (or download [here](https://www.dropbox.com/s/y1xp27ktd41js1o/pm_populism.txt?dl=0)). There are some minor trip ups here and there, but nothing you can't clean up really quickly.\n![](../images/body-d7c917891682b57d63d1.png)\nI ran the raw transcript on 2 transformer models fine-tuned for summarisation, FB's \"[bart-large-cnn](https://huggingface.co/facebook/bart-large-cnn)\" and Google's \"[pegasus-large](https://huggingface.co/google/pegasus-large)\".\nHere's the result from Bart:\n![](../images/body-cd23939df441e50bb8c8.png)\nThis is the summary by Pegasus:\n![](../images/body-f2b4055fb4bb62bfa3c3.png)\nBoth models did well in first capturing the speaker's broad definition of populism, followed by the inclusion of his elaboration about how Singapore tried to avoid the problem.\nBut the FB-Bart model didn't capture any details from the second part of Mr Lee's comments. Meanwhile, the Pegasus model captured too much from the first part of his comments, and not enough of the second half. Neither version would pass for a good summary, in my view, though to be fair, both models weren't trained on political speeches.\nSo yet again, we see that the chain-linking of NLP tasks via Wav2Vec2 and transformers is technically viable, but the results are not always satisfactory.\n* * *\n## CONCLUSION\nThese are exciting times for folks working in NLP, and Wav2Vec2 looks set to open up a whole new range of possibilities. With Hugging Face [initiating a sprint to extend Wav2Vec2 to other languages](https://twitter.com/huggingface/status/1372180102977568770) (beyond English), the scope for \"chain-linking\" NLP tasks can only grow.\nBut given existing limitations on Wav2Vec2 and the inherent difficulties in many NLP tasks such as summarisation, it is probably wiser to add a \"pause\" button in the process.\nBy that I mean results will be better if the raw Wav2Vec2 transcripts are cleaned up before they are fed downstream to other NLP tasks. Otherwise the problematic areas in the transcript get compounded, resulting in sub-par results elsewhere.\nAs always, if you spot mistakes in this or any of my earlier posts, ping me at:\n  * Twitter: [Chua Chin Hon](https://medium.com/u/b3d8090c0aee?source=post_page-----aad7f2e1d0a0----------------------)\n  * LinkedIn: [www.linkedin.com/in/chuachinhon](http://www.linkedin.com/in/chuachinhon)\n\n\nThe repo for this post, containing the data and notebooks for the charts, can be found [here](https://github.com/chuachinhon/wav2vec2_transformers).\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](../images/body-d56b810b4697a0fbf983.png)\nWritten By\n## [Chua Chin Hon](https://towardsdatascience.com/author/chuachinhon/)\n[See all from Chua Chin Hon](https://towardsdatascience.com/author/chuachinhon/)\n[AI](https://towardsdatascience.com/tag/ai/)[Data Science](https://towardsdatascience.com/tag/data-science/)[Hugging Face](https://towardsdatascience.com/tag/hugging-face/)[Machine Learning](https://towardsdatascience.com/tag/machine-learning/)[NLP](https://towardsdatascience.com/tag/nlp/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fchain-linking-nlp-tasks-with-wav2vec2-transformers-7297181db3a7%2F&title=%22Chain-linking%22%20NLP%20tasks%20With%20Wav2Vec2%20%26%20Transformers)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fchain-linking-nlp-tasks-with-wav2vec2-transformers-7297181db3a7%2F&title=%22Chain-linking%22%20NLP%20tasks%20With%20Wav2Vec2%20%26%20Transformers)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fchain-linking-nlp-tasks-with-wav2vec2-transformers-7297181db3a7%2F&text=%22Chain-linking%22%20NLP%20tasks%20With%20Wav2Vec2%20%26%20Transformers)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](../images/005.jpeg)](https://towardsdatascience.com/getting-started-with-pytorch-2819d7aeb87c/)\n## [Getting started with PyTorch](https://towardsdatascience.com/getting-started-with-pytorch-2819d7aeb87c/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nLearn the basics through examples\n[André Ribeiro](https://towardsdatascience.com/author/andrefsr/)\nJune 30, 20213 min read\n  * [![](../images/006.jpeg)](https://towardsdatascience.com/interpretable-machine-learning-1dec0f2f3e6b/)\n## [Interpretable Machine Learning](https://towardsdatascience.com/interpretable-machine-learning-1dec0f2f3e6b/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nExtracting human understandable insights from any Machine Learning model\n[Parul Pandey](https://towardsdatascience.com/author/pandeyparul/)\nApril 2, 20199 min read\n  * [![](../images/007.jpg)](https://towardsdatascience.com/understanding-probability-models-and-axioms-c0f498972b80/)\n## [Understanding Probability Models and Axioms](https://towardsdatascience.com/understanding-probability-models-and-axioms-c0f498972b80/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nWhy even care about sample space, events, and probability measures?\n[Marvin Lanhenke](https://towardsdatascience.com/author/marvinlanhenke/)\nDecember 18, 20217 min read\n  * [![](../images/008.png)](https://towardsdatascience.com/visualize-your-strava-data-on-an-interactive-map-with-python-92c1ce69e91d/)\n## [Visualize Your Strava Data on an Interactive Map with Python](https://towardsdatascience.com/visualize-your-strava-data-on-an-interactive-map-with-python-92c1ce69e91d/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nUse the Strava API with Python to download you activity data, create an elevation profile and plot your activity details on an interactive...\n[René](https://towardsdatascience.com/author/brinkhuis/)\nOctober 19, 20216 min read\n  * [![](../images/009.jpg)](https://towardsdatascience.com/5-quick-and-easy-tips-to-become-an-efficient-data-scientist-in-both-python-and-r-5cf51f6396a3/)\n## [5 Quick and Easy Tips to Become an Efficient Data Scientist in Both Python and R](https://towardsdatascience.com/5-quick-and-easy-tips-to-become-an-efficient-data-scientist-in-both-python-and-r-5cf51f6396a3/)\n[Programming](https://towardsdatascience.com/category/programming/)\nHaving difficulty transitioning between using Python and R? Try these tips to make the transition smoother\n[Madison Hunter](https://towardsdatascience.com/author/madison13/)\nNovember 8, 20229 min read\n  * [![](../images/010.jpeg)](https://towardsdatascience.com/implementing-streamlit-authenticator-across-multi-page-apps-5ad70ac315b3/)\n## [Implementing Streamlit-Authenticator Across Multi-Page Apps](https://towardsdatascience.com/implementing-streamlit-authenticator-across-multi-page-apps-5ad70ac315b3/)\n[Programming](https://towardsdatascience.com/category/programming/)\nStreamlit-Authenticator allows you to add a simple yet robust method for user authentication in a Streamlit application.\n[Brian Roepke](https://towardsdatascience.com/author/broepke/)\nNovember 23, 20246 min read\n  * [![](../images/011.png)](https://towardsdatascience.com/nodepiece-tokenizing-knowledge-graphs-6dd2b91847aa/)\n## [NodePiece: Tokenizing Knowledge Graphs](https://towardsdatascience.com/nodepiece-tokenizing-knowledge-graphs-6dd2b91847aa/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nMapping each node to an embedding vector results in enormously large embedding matrices. Is there a way to have a fixed-size vocabulary of...\n[Michael Galkin](https://towardsdatascience.com/author/mgalkin/)\nJune 24, 202110 min read\n  * [![](../images/012.png)](https://towardsdatascience.com/how-to-make-your-own-instagram-filter-with-facial-recognition-from-scratch-using-python-d3a42029e65b/)\n## [How to make your own Instagram filter with facial recognition from scratch using python](https://towardsdatascience.com/how-to-make-your-own-instagram-filter-with-facial-recognition-from-scratch-using-python-d3a42029e65b/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nOver the past 10 years, Facial recognition technology has developed rapidly and has quickly developed a variety of uses. From the...\n[Mitchell Krieger](https://towardsdatascience.com/author/mitchellkrieger/)\nOctober 27, 20205 min read\n  * [![](../images/013.jpg)](https://towardsdatascience.com/how-metrics-and-llms-can-trick-you-a-field-guide-to-paradoxes/)\n## [How Metrics (and LLMs) Can Trick You: A Field Guide to Paradoxes](https://towardsdatascience.com/how-metrics-and-llms-can-trick-you-a-field-guide-to-paradoxes/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nWhen numbers lie — and your metrics mislead you\n[Subha Ganapathi](https://towardsdatascience.com/author/mg-subha/)\nJuly 15, 20257 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500) Productivity Tips, Data Career Insights, and Other Recent Must-Reads ](https://towardsdatascience.com/productivity-tips-data-career-insights-and-other-recent-must-reads-5c47eb7a2fe0/ \"Productivity Tips, Data Career Insights, and Other Recent Must-Reads\")\n\n\n",
  "metadata": {
    "title": "\"Chain-linking\" NLP tasks With Wav2Vec2 & Transformers | Towards Data Science",
    "description": "Going straight from audio to a range of text-based NLP tasks such as translation, summarisation and sentiment analysis.",
    "keywords": null,
    "author": "Chua Chin Hon",
    "og:locale": "en_US",
    "og:type": "article",
    "og:title": "\"Chain-linking\" NLP tasks With Wav2Vec2 & Transformers",
    "og:description": "Going straight from audio to a range of text-based NLP tasks such as translation, summarisation and sentiment analysis.",
    "og:url": "https://towardsdatascience.com/chain-linking-nlp-tasks-with-wav2vec2-transformers-7297181db3a7/",
    "og:site_name": "Towards Data Science",
    "og:image": "https://assets.insightmediagroup.io/media/wp-content/uploads/2021/03/1-Mdy5zA3Iq_aVt8JwcPnuA.png",
    "og:image:width": "2519",
    "og:image:height": "1354",
    "og:image:type": "image/png",
    "twitter:card": "summary_large_image",
    "twitter:site": "@TDataScience",
    "twitter:creator": "@TDataScience",
    "twitter:label1": "Written by",
    "twitter:data1": "Chua Chin Hon",
    "twitter:label2": "Est. reading time",
    "twitter:data2": "6 min read",
    "article:published_time": "2021-03-19T08:01:11.000Z",
    "article:modified_time": "2021-03-19T08:01:11.000Z",
    "article:author": "https://towardsdatascience.com/author/chuachinhon/"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [],
  "images": [
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:56:54Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:56:54Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:56:54Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:56:54Z"
    }
  ],
  "audio": [],
  "videos": [
    {
      "url": "https://www.youtube.com/watch?v=sZBquj94CGU",
      "status": "ok",
      "local_path": "attachments/bb2fb6fad5b2/videos/repair-sZBquj94CGU.mp4",
      "bytes": 194070765,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "1444.001000"
    },
    {
      "url": "https://www.youtube.com/watch?v=JYBatFW-BP4",
      "status": "ok",
      "local_path": "attachments/bb2fb6fad5b2/videos/repair-JYBatFW-BP4.mp4",
      "bytes": 114601804,
      "valid": true,
      "height": 720,
      "width": 1280,
      "duration": "1450.021000"
    },
    {
      "url": "https://www.youtube.com/watch?v=4bUl9R2N90A",
      "status": "ok",
      "local_path": "attachments/bb2fb6fad5b2/videos/repair-4bUl9R2N90A.mp4",
      "bytes": 43676822,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "240.641000"
    },
    {
      "url": "https://www.youtube.com/c/TowardsDataScience",
      "kind": "channel_reference",
      "status": "reference_only"
    }
  ],
  "links": [
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/latest/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/editors-pick/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/the-variable/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/shipai/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/submissions/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/data-science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/chuachinhon/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/transcribing-poetry-and-speeches-with-wav2vec2-2658c6510f06"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/ai/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/data-science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/hugging-face/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/machine-learning/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/nlp/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/getting-started-with-pytorch-2819d7aeb87c/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/artificial-intelligence/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/andrefsr/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/interpretable-machine-learning-1dec0f2f3e6b/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/pandeyparul/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/understanding-probability-models-and-axioms-c0f498972b80/"
    },
    {
      "type": "external",
      "href": "https://write.insightmediagroup.io"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/company/towards-data-science/"
    },
    {
      "type": "external",
      "href": "https://x.com/TDataScience"
    },
    {
      "type": "external",
      "href": "https://huggingface.co/transformers/model_doc/wav2vec2.html"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/ai-data-scientist"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/machine-learning"
    },
    {
      "type": "external",
      "href": "https://github.com/chuachinhon/wav2vec2_transformers"
    },
    {
      "type": "external",
      "href": "https://pypi.org/project/transformers/"
    },
    {
      "type": "external",
      "href": "https://pypi.org/project/librosa/"
    },
    {
      "type": "external",
      "href": "https://github.com/huggingface/transformers/issues/10366"
    },
    {
      "type": "external",
      "href": "https://www.audacityteam.org/"
    },
    {
      "type": "external",
      "href": "https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self"
    },
    {
      "type": "external",
      "href": "https://www.youtube.com/watch?v=sZBquj94CGU"
    },
    {
      "type": "external",
      "href": "https://www.youtube.com/watch?v=JYBatFW-BP4"
    },
    {
      "type": "external",
      "href": "https://github.com/chuachinhon/wav2vec2_transformers/blob/main/notebooks/3.0_transcribe_translate_sentiment_analysis.ipynb"
    },
    {
      "type": "external",
      "href": "https://www.theatlantic.com/magazine/archive/2020/01/joe-biden-stutter-profile/602401/"
    },
    {
      "type": "external",
      "href": "https://www.dropbox.com/s/aybqx2jex5cg202/biden_alt.txt?dl=0"
    },
    {
      "type": "external",
      "href": "https://huggingface.co/transformers/model_doc/marian.html"
    },
    {
      "type": "external",
      "href": "https://github.com/chuachinhon/practical_nlp/blob/master/notebooks/4.0_english_to_chinese_translate.ipynb"
    },
    {
      "type": "external",
      "href": "https://www.dropbox.com/s/lricsuk8xw3ry8d/biden_translated_alt.txt?dl=0"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-20T17:29:27Z",
  "source_url": "https://towardsdatascience.com/chain-linking-nlp-tasks-with-wav2vec2-transformers-7297181db3a7/",
  "delivery_status": "unverified",
  "discovery_status": "http_403",
  "missing_reason": "源页面未重新核验:http_403；已按保留正文补采图片",
  "repair_error": "",
  "actual_video_files": [
    {
      "local_path": "attachments/bb2fb6fad5b2/videos/repair-4bUl9R2N90A.mp4",
      "bytes": 43676822,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "240.641000",
      "status": "ok"
    },
    {
      "local_path": "attachments/bb2fb6fad5b2/videos/repair-JYBatFW-BP4.mp4",
      "bytes": 114601804,
      "valid": true,
      "height": 720,
      "width": 1280,
      "duration": "1450.021000",
      "status": "ok"
    },
    {
      "local_path": "attachments/bb2fb6fad5b2/videos/repair-sZBquj94CGU.mp4",
      "bytes": 194070765,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "1444.001000",
      "status": "ok"
    }
  ],
  "expected_saved_body_images": 4,
  "image_discovery": "saved_markdown",
  "source_body_markdown": "![Revisit consent button](https://cdn-cookieyes.com/assets/images/revisit.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](https://cdn-cookieyes.com/assets/images/close.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Data Science](https://towardsdatascience.com/category/data-science/)\n# \"Chain-linking\" NLP tasks With Wav2Vec2 & Transformers\nGoing straight from audio to a range of text-based NLP tasks such as translation, summarisation and sentiment analysis.\n[Chua Chin Hon](https://towardsdatascience.com/author/chuachinhon/)\nMarch 19, 20216 min read\n### Going straight from audio to a range of text-based NLP tasks such as translation, summarisation and sentiment analysis\n![Chart: Chua Chin Hon](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/03/1xq91N5qzjsLIS9m921E6nw.png)\nChart: Chua Chin Hon\nThe addition of the [Wav2Vec2](https://huggingface.co/transformers/model_doc/wav2vec2.html) model in Hugging Face's transformers library has been one of the more exciting developments in NLP in recent months. Until then, it wasn't easy to execute tasks like machine translation or sentiment analysis if you only had a long audio clip to work with.\nBut now you can link up an interesting combination of NLP tasks in one go: transcribe the audio clip with Wav2Vec2, and then use a variety of transformer models to summarize or translate the transcript. The possible permutations and combinations of NLP tasks that you can link up is pretty mind boggling.\nResults could be patchy, of course. Some NLP tasks, such as summarisation, are very hard to crack by nature.\nThis post, a follow-up to my [earlier one on Wav2Vec2 trials](https://towardsdatascience.com/transcribing-poetry-and-speeches-with-wav2vec2-2658c6510f06), will outline 2 trials:\nLearn this step by step with the interactive [AI and Data Scientist](https://roadmap.sh/ai-data-scientist) and [Machine Learning](https://roadmap.sh/machine-learning) roadmaps.\n  * **#1: Speech-to-text-to-translation & sentiment analysis**\n  * **#2: Speech-to-text-to-summarisation**\n\n\n* * *\n## REPO, REQUIREMENTS, AND REFERENCES\nThe notebooks and audio files needed for the trials are in my [repo](https://github.com/chuachinhon/wav2vec2_transformers). Additionally, you'll need these to run the notebooks:\n  * [Transformers ≥ 4.3](https://pypi.org/project/transformers/)\n  * [Librosa](https://pypi.org/project/librosa/) (to manage the audio files)\n\n\nThe code in most of the notebooks have been updated to use a better approach for transcribing long audio files, via a post on Github by [Hugging Face's machine learning engineer Lysandre Jik](https://github.com/huggingface/transformers/issues/10366).\nIn my earlier work-around, I used [Audacity](https://www.audacityteam.org/) to manually split up long audio clips into smaller, more manageable pieces (audio clips longer than ~90s tend to crash local machines and Colab). Lysandre's code eliminates this step by using Librosa to stream in the long audio clip in shorter, fixed \"chunks\".\nThere are several versions of the Wav2Vec2 model on Hugging Face's model hub. For this post, I'll be using the [wav2vec2-large-960h-lv60-self](https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self) model.\n* * *\n## TRIAL #1: TRANSCRIBE + TRANSLATE + SENTIMENT ANALYSIS\n![Screen-grab on right via CNBC Television&#039;s YouTube channel](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/03/1-Mdy5zA3Iq_aVt8JwcPnuA.png)\nScreen-grab on right via [CNBC Television's YouTube](https://www.youtube.com/watch?v=sZBquj94CGU) channel\nFor this trial, I opted for US President Joe Biden's [first prime time speech](https://www.youtube.com/watch?v=JYBatFW-BP4) on Mar 11/12 2021 (depending on which time zone you are in).\nHis speech was about 24 minutes long, and I streamed it to Wav2Vec2 via 25-second chunks. You can opt for longer or shorter chunks. I found 25s to give decent results. Details are in [notebook3.0](https://github.com/chuachinhon/wav2vec2_transformers/blob/main/notebooks/3.0_transcribe_translate_sentiment_analysis.ipynb) in my repo, and I won't repeat them here.\nThe speech is complex and [Biden is known to be fighting a stutter](https://www.theatlantic.com/magazine/archive/2020/01/joe-biden-stutter-profile/602401/). The transcript (download directly [here](https://www.dropbox.com/s/aybqx2jex5cg202/biden_alt.txt?dl=0)) is pretty rough in some parts, especially towards the end:\n![Download raw Wav2Vec2 transcript here](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/03/16rO2ckeQksFReFfSZBLSLw.png)\nDownload raw Wav2Vec2 transcript [here](https://www.dropbox.com/s/aybqx2jex5cg202/biden_alt.txt?dl=0)\nTo be fair, Biden spoke pretty clearly in my view, and this is an example where the Wav2Vec2 model struggled. But the model took just 12 minutes or so on my late-2015 iMac to produce the transcript, which is way, way faster than if I were to do it manually.\nNext, I wanted to pipe the transcript of Biden's speech to a machine translation model and see what the quality is like for a Chinese translation. I used [Hugging Face's implementation of MarianMT](https://huggingface.co/transformers/model_doc/marian.html) for this, as I've tried it on a few speeches [previously](https://github.com/chuachinhon/practical_nlp/blob/master/notebooks/4.0_english_to_chinese_translate.ipynb).\nThe results are borderline unusable, unfortunately. Download the full Chinese translation [here](https://www.dropbox.com/s/lricsuk8xw3ry8d/biden_translated_alt.txt?dl=0):\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/03/1RvXEtp-ZNTzvLiG5YxTCEQ.png)\nThe \"chain-linking\" process works well from a technical perspective, and you just need about 10 additional lines of code after the Wav2Vec2 process.\nBut the quality of the translation clearly suffers when the problematic parts of the raw transcript were fed to the MarianMT model without a thorough clean up of the missing or wrong words, and proper punctuation. I added full stops (\".\") at the end of each 25s-worth of text transcript from Wav2Vec2, but that clearly doesn't capture the correct start and end of each sentence in the original speech.\nSo while it seems that \"chain-linking\" the NLP tasks would save a lot of time, the problems in one area can and will compound, resulting in lower quality results for tasks that are further downstream.\nClearly it will take additional time to clean up the raw English transcript. But I believe doing so would improve the quality of the Chinese translation considerably. As for accurate punctuation, there is no quick way to do it within Wav2Vec2 right now. But I suspect future versions of the model would resolve this issue, seeing that a number of auto-speech-recognition services on the market already have the \"add punctuation\" feature.\nNext, I wanted to try applying sentiment analysis to Biden's speech. The combination of speech-to-text with sentiment analysis can be really useful in political or business settings, where a quick understanding of the speaker's sentiment can affect certain decisions.\nThe raw transcript was turned into a simple data-frame, and I then used Hugging Face's transformers pipeline and Plotly to generate a \"sentiment-structure\" chart like the one below. I have been experimenting with these sentiment charts for a while. My earlier experiments can be found [here](https://github.com/chuachinhon/practical_nlp/blob/master/notebooks/1.0_speech_sentiment_cch.ipynb).\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/03/1xq91N5qzjsLIS9m921E6nw.png)\nThis worked better than the attempt at Chinese translation, though I'm sure the sentiment analysis would also benefit from a thorough clean up and the inclusion of proper punctuation in the raw English transcript.\nThere's technically no reason why one would stop at just 3 tasks. You can easily write a few more lines of code and include summarisation as the 4th NLP task in a row.\nBut auto-summarisation of long text documents, including speeches, remain a highly challenging task even for transformer models. The results aren't ready for prime-time, in my view. Let's take a closer look in the next trial.\n## TRIAL #2: TRANSCRIBE + SUMMARISE\n![Screen-grab via the YouTube channel of the Singapore Prime Minister&#039;s Office.](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/03/1bB4tr6pMlTiZ_xzXCjn72w.png)\nScreen-grab via the [YouTube channel of the Singapore Prime Minister's Office](https://www.youtube.com/watch?v=4bUl9R2N90A).\nFor this I picked a shorter audio clip, a 4-minute video of [Singapore Prime Minister Lee Hsien Loong responding to a question on populism](https://www.youtube.com/watch?v=4bUl9R2N90A) at a business conference in 2019. The clip focuses on a singular issue, but has enough complexity for it to be challenging for any auto-summarisation model.\nSee [notebook3.1](https://github.com/chuachinhon/wav2vec2_transformers/blob/main/notebooks/3.1_transcribe_summarise.ipynb) in my repo for details.\nThe Wav2Vec2 output is excellent, as you can see below (or download [here](https://www.dropbox.com/s/y1xp27ktd41js1o/pm_populism.txt?dl=0)). There are some minor trip ups here and there, but nothing you can't clean up really quickly.\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/03/1H-rGzylpu7URa5GRw7w2UQ.png)\nI ran the raw transcript on 2 transformer models fine-tuned for summarisation, FB's \"[bart-large-cnn](https://huggingface.co/facebook/bart-large-cnn)\" and Google's \"[pegasus-large](https://huggingface.co/google/pegasus-large)\".\nHere's the result from Bart:\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/03/108Y3kmNv7gcplR2vvJxJCA.png)\nThis is the summary by Pegasus:\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/03/1UrtslYGMvZon16GXilAjwQ.png)\nBoth models did well in first capturing the speaker's broad definition of populism, followed by the inclusion of his elaboration about how Singapore tried to avoid the problem.\nBut the FB-Bart model didn't capture any details from the second part of Mr Lee's comments. Meanwhile, the Pegasus model captured too much from the first part of his comments, and not enough of the second half. Neither version would pass for a good summary, in my view, though to be fair, both models weren't trained on political speeches.\nSo yet again, we see that the chain-linking of NLP tasks via Wav2Vec2 and transformers is technically viable, but the results are not always satisfactory.\n* * *\n## CONCLUSION\nThese are exciting times for folks working in NLP, and Wav2Vec2 looks set to open up a whole new range of possibilities. With Hugging Face [initiating a sprint to extend Wav2Vec2 to other languages](https://twitter.com/huggingface/status/1372180102977568770) (beyond English), the scope for \"chain-linking\" NLP tasks can only grow.\nBut given existing limitations on Wav2Vec2 and the inherent difficulties in many NLP tasks such as summarisation, it is probably wiser to add a \"pause\" button in the process.\nBy that I mean results will be better if the raw Wav2Vec2 transcripts are cleaned up before they are fed downstream to other NLP tasks. Otherwise the problematic areas in the transcript get compounded, resulting in sub-par results elsewhere.\nAs always, if you spot mistakes in this or any of my earlier posts, ping me at:\n  * Twitter: [Chua Chin Hon](https://medium.com/u/b3d8090c0aee?source=post_page-----aad7f2e1d0a0----------------------)\n  * LinkedIn: [www.linkedin.com/in/chuachinhon](http://www.linkedin.com/in/chuachinhon)\n\n\nThe repo for this post, containing the data and notebooks for the charts, can be found [here](https://github.com/chuachinhon/wav2vec2_transformers).\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](https://assets.insightmediagroup.io/media/1787657280763_838i2j.png)\nWritten By\n## [Chua Chin Hon](https://towardsdatascience.com/author/chuachinhon/)\n[See all from Chua Chin Hon](https://towardsdatascience.com/author/chuachinhon/)\n[AI](https://towardsdatascience.com/tag/ai/)[Data Science](https://towardsdatascience.com/tag/data-science/)[Hugging Face](https://towardsdatascience.com/tag/hugging-face/)[Machine Learning](https://towardsdatascience.com/tag/machine-learning/)[NLP](https://towardsdatascience.com/tag/nlp/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fchain-linking-nlp-tasks-with-wav2vec2-transformers-7297181db3a7%2F&title=%22Chain-linking%22%20NLP%20tasks%20With%20Wav2Vec2%20%26%20Transformers)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fchain-linking-nlp-tasks-with-wav2vec2-transformers-7297181db3a7%2F&title=%22Chain-linking%22%20NLP%20tasks%20With%20Wav2Vec2%20%26%20Transformers)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fchain-linking-nlp-tasks-with-wav2vec2-transformers-7297181db3a7%2F&text=%22Chain-linking%22%20NLP%20tasks%20With%20Wav2Vec2%20%26%20Transformers)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/06/106QT9w9D_SYm82I-9J6lHA.jpeg)](https://towardsdatascience.com/getting-started-with-pytorch-2819d7aeb87c/)\n## [Getting started with PyTorch](https://towardsdatascience.com/getting-started-with-pytorch-2819d7aeb87c/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nLearn the basics through examples\n[André Ribeiro](https://towardsdatascience.com/author/andrefsr/)\nJune 30, 20213 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2019/04/1ECEwUpioFP_mGz_E5LOC4A-scaled.jpeg)](https://towardsdatascience.com/interpretable-machine-learning-1dec0f2f3e6b/)\n## [Interpretable Machine Learning](https://towardsdatascience.com/interpretable-machine-learning-1dec0f2f3e6b/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nExtracting human understandable insights from any Machine Learning model\n[Parul Pandey](https://towardsdatascience.com/author/pandeyparul/)\nApril 2, 20199 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/12/0S-fQ7kmjq6OY0GUb-scaled.jpg)](https://towardsdatascience.com/understanding-probability-models-and-axioms-c0f498972b80/)\n## [Understanding Probability Models and Axioms](https://towardsdatascience.com/understanding-probability-models-and-axioms-c0f498972b80/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nWhy even care about sample space, events, and probability measures?\n[Marvin Lanhenke](https://towardsdatascience.com/author/marvinlanhenke/)\nDecember 18, 20217 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/10/1jxWkuS1935lEbcmW7kleHQ.png)](https://towardsdatascience.com/visualize-your-strava-data-on-an-interactive-map-with-python-92c1ce69e91d/)\n## [Visualize Your Strava Data on an Interactive Map with Python](https://towardsdatascience.com/visualize-your-strava-data-on-an-interactive-map-with-python-92c1ce69e91d/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nUse the Strava API with Python to download you activity data, create an elevation profile and plot your activity details on an interactive...\n[René](https://towardsdatascience.com/author/brinkhuis/)\nOctober 19, 20216 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/0cGkB7xigCEYgVANb-scaled.jpg)](https://towardsdatascience.com/5-quick-and-easy-tips-to-become-an-efficient-data-scientist-in-both-python-and-r-5cf51f6396a3/)\n## [5 Quick and Easy Tips to Become an Efficient Data Scientist in Both Python and R](https://towardsdatascience.com/5-quick-and-easy-tips-to-become-an-efficient-data-scientist-in-both-python-and-r-5cf51f6396a3/)\n[Programming](https://towardsdatascience.com/category/programming/)\nHaving difficulty transitioning between using Python and R? Try these tips to make the transition smoother\n[Madison Hunter](https://towardsdatascience.com/author/madison13/)\nNovember 8, 20229 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2024/11/0nCQnY7aEHHigxeHr.jpeg)](https://towardsdatascience.com/implementing-streamlit-authenticator-across-multi-page-apps-5ad70ac315b3/)\n## [Implementing Streamlit-Authenticator Across Multi-Page Apps](https://towardsdatascience.com/implementing-streamlit-authenticator-across-multi-page-apps-5ad70ac315b3/)\n[Programming](https://towardsdatascience.com/category/programming/)\nStreamlit-Authenticator allows you to add a simple yet robust method for user authentication in a Streamlit application.\n[Brian Roepke](https://towardsdatascience.com/author/broepke/)\nNovember 23, 20246 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/06/1yYt_5YzZHpfMu4T1j1tXyg.png)](https://towardsdatascience.com/nodepiece-tokenizing-knowledge-graphs-6dd2b91847aa/)\n## [NodePiece: Tokenizing Knowledge Graphs](https://towardsdatascience.com/nodepiece-tokenizing-knowledge-graphs-6dd2b91847aa/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nMapping each node to an embedding vector results in enormously large embedding matrices. Is there a way to have a fixed-size vocabulary of...\n[Michael Galkin](https://towardsdatascience.com/author/mgalkin/)\nJune 24, 202110 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/10/1x9WADlsrxHtORqXATsb39Q.png)](https://towardsdatascience.com/how-to-make-your-own-instagram-filter-with-facial-recognition-from-scratch-using-python-d3a42029e65b/)\n## [How to make your own Instagram filter with facial recognition from scratch using python](https://towardsdatascience.com/how-to-make-your-own-instagram-filter-with-facial-recognition-from-scratch-using-python-d3a42029e65b/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nOver the past 10 years, Facial recognition technology has developed rapidly and has quickly developed a variety of uses. From the...\n[Mitchell Krieger](https://towardsdatascience.com/author/mitchellkrieger/)\nOctober 27, 20205 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2025/07/luke-chesser-JKUTrJ4vK00-unsplash-scaled-1.jpg)](https://towardsdatascience.com/how-metrics-and-llms-can-trick-you-a-field-guide-to-paradoxes/)\n## [How Metrics (and LLMs) Can Trick You: A Field Guide to Paradoxes](https://towardsdatascience.com/how-metrics-and-llms-can-trick-you-a-field-guide-to-paradoxes/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nWhen numbers lie — and your metrics mislead you\n[Subha Ganapathi](https://towardsdatascience.com/author/mg-subha/)\nJuly 15, 20257 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500) Productivity Tips, Data Career Insights, and Other Recent Must-Reads ](https://towardsdatascience.com/productivity-tips-data-career-insights-and-other-recent-must-reads-5c47eb7a2fe0/ \"Productivity Tips, Data Career Insights, and Other Recent Must-Reads\")\n\n\n",
  "body_base_path": "attachments/bb2fb6fad5b2/pages/",
  "body_markdown_path": "attachments/bb2fb6fad5b2/pages/archived-body.md",
  "local_html": "attachments/bb2fb6fad5b2/pages/archived-body.html",
  "body_source": "prior_capture"
}