# Build a Twitter topic extractor

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbuild-a-twitter-topic-extractor%2F11571%3E%5C
**Category:** 🤗 Course Projects\
**Created:** [November 10, 2021, 4:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbuild-a-twitter-topic-extractor%2F11571 "2021-11-10T16:45:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lewtun](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lewtun/32/30995_2.png) [@lewtun](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Flewtun)%5C
**Post date:** [November 10, 2021, 4:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbuild-a-twitter-topic-extractor%2F11571%2F1 "2021-11-10T16:45:52Z")

</div>

> 👋 Please read the topic category [description](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fabout-the-course-projects-category%2F11510) to understand what this is all about

### Description

Twitter classifies trending tweets according to predefined set of topics like “Data science”, “Hip hop”, “Sport” etc. However, their algorithm appears to often get confused by certain keywords in the tweet or the content of the image (see [here](https://twitter.com/Michael_D_Moor/status/1457425576583647233?s=20) for some funny examples).

The goal of this project is to explore whether it’s possible to create a better topic extractor, or at least one that is more targeted for a smaller set of domains. There’s several ways to approach to task:

- Frame it as a multiclass classification problem
- Frame it as an unsupervised clustering problem, and combine this with techniques like [UMAP](https://umap-learn.readthedocs.io/en/latest/clustering.html) and/or HDBSCAN

### Model(s)

Since Tweets are short in length, picking one of the `sentence-transformers` [models on the Hub](https://huggingface.co/sentence-transformers) is likely a good place to start.

### Datasets

There are various Twitter datasets on the Hub and here’s a few examples to start with:

- [tweet\_eval](https://huggingface.co/datasets/tweet_eval)
- [sentiment140](https://huggingface.co/datasets/sentiment140)
- [emotion](https://huggingface.co/datasets/emotion)

### Challenges

If you take the unsupervised learning approach, be warned that there’s no “correct” answer and you will have to experiment with the dimensionality reduction / cluster algorithms to get meaningful clusters.

### Desired project outcomes

- Create a Streamlit or Gradio app on [🤗 Spaces](https://huggingface.co/spaces) that either can automatically classify a Tweet according to a topic, or visualises the 2D projection of the embeddings and colours them by topic.
- Don’t forget to push all your models and datasets to the Hub so others can build on them!

### Additional resources

- [https://towardsdatascience.com/how-exactly-umap-works-13e3040e1668](https://towardsdatascience.com/how-exactly-umap-works-13e3040e1668)
- [https://huggingface.co/spaces/edugp/embedding-lenses](https://huggingface.co/spaces/edugp/embedding-lenses) (useful for UMAP inspiration)

### Discord channel

To chat and organise with other people interested in this project, head over to our [Discord](http://xwo7x.mjt.lu/lnk/CAAAAkdkZwAAAAAAAAAAALG-MTEAAYCr4H8AAAAAAAyFyQBhjpnimM4rcE5DT5ibCUtRT96tWwAMh8Y/15/U6BYNMNDksyyGG4jgtzPKQ/aHR0cHM6Ly9odWdnaW5nZmFjZS5jby9qb2luL2Rpc2NvcmQ) and:

- Follow the instructions on the `#join-course` channel

- Join the `#twitter-topic-extractor` channel

Just make sure you comment here to indicate that you’ll be contributing to this project 🙂

---

<div class="post-metadata">

**Author:** ![wilmerags](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/wilmerags/32/3156_2.png) [@wilmerags](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fwilmerags)%5C
**Post date:** [November 15, 2021, 8:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbuild-a-twitter-topic-extractor%2F11571%2F2 "2021-11-15T20:11:26Z")

</div>

I’d like to work on this project! 🚀

---

<div class="post-metadata">

**Author:** ![rg089](https://avatars.discourse-cdn.com/v4/letter/r/ed655f/32.png) [@rg089](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Frg089)%5C
**Post date:** [November 16, 2021, 9:53pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbuild-a-twitter-topic-extractor%2F11571%2F3 "2021-11-16T21:53:40Z")

</div>

I’d like to join this project!

---

<div class="post-metadata">

**Author:** ![alghar](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@alghar](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Falghar)%5C
**Post date:** [November 17, 2021, 12:27am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbuild-a-twitter-topic-extractor%2F11571%2F4 "2021-11-17T00:27:02Z")

</div>

I am interested as well. What is your timeframe?

---

<div class="post-metadata">

**Author:** ![wilmerags](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/wilmerags/32/3156_2.png) [@wilmerags](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fwilmerags)%5C
**Post date:** [November 17, 2021, 1:27am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbuild-a-twitter-topic-extractor%2F11571%2F5 "2021-11-17T01:27:37Z")

</div>

I think that the project needs to be available for reviewal in November 24th.

---

<div class="post-metadata">

**Author:** ![alghar](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@alghar](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Falghar)%5C
**Post date:** [November 17, 2021, 5:29am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbuild-a-twitter-topic-extractor%2F11571%2F6 "2021-11-17T05:29:52Z")

</div>

Hello Wilmer,

Would you like to have a zoom chat tomorrow (after the class)?

I am in Calif (-3 hours from you)  
Al

---

<div class="post-metadata">

**Author:** ![wilmerags](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/wilmerags/32/3156_2.png) [@wilmerags](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fwilmerags)%5C
**Post date:** [November 19, 2021, 2:53am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbuild-a-twitter-topic-extractor%2F11571%2F7 "2021-11-19T02:53:00Z")

</div>

Oh sorry didn’t see this, Yes, let’s catch up in discord 😉

---

<div class="post-metadata">

**Author:** ![anupama4821](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@anupama4821](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fanupama4821)%5C
**Post date:** [March 7, 2023, 1:43pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbuild-a-twitter-topic-extractor%2F11571%2F8 "2023-03-07T13:43:00Z")

</div>

Interested
