Run in Google Colab
|
View on GitHub
|
Homework 11 - Text (optional)¶
In this homework, you will create a text visualization of a dataset of your choice. It can be either a collection of text documents (like tweets, news articles, etc) or a single text document. You can get text data from various sources, such as Kaggle datasets, or Gutenberg Project, or any other source that provides text data. Then you will use any tecniques you learned in class to visualize the text data. Explain the visualization and its insights or limitations in case you don't find any insights.
Instructions¶
Project Setup:
- Set up your Python and Jupyter (or VSCode) environment.
- Clone or download the repository provided in class (refer to the class notes).
Choose a Dataset:
- Select a dataset that contains text data. It can be anything from tweets, news articles, books, or any other text-based dataset. Ensure that the dataset is in a format that can be easily read into Python (like CSV, JSON, TXT, etc.).
Identify the text content:
- Identify which features in the dataset contain the text data you want to visualize. For example, if you are using a dataset of tweets, the text content will be in the 'text' or 'content' column.
Choose at least two text visualization techniques and apply them to the data:
- You can use techniques such as:
- Word clouds
- Frequency distribution of words
- Adjacency networks
- Syntactic parsing visualization
- Topic modeling visualization
- Named entity recognition visualization
- Any other text visualization technique you learned in class
- You can use the hands-on class examples as reference (feel free to copy and modify the code as needed).
- You can use techniques such as:
Documentation and discussion:
- Comment your code and add markdown explanations for each part of your analysis.
- Discuss the insights you gained from the visualizations. If you do not find any insights, explain the limitations of the dataset or the visualization techniques used.
Submission:
- Ensure your notebook is complete and all cells are executed without errors.
- Save your notebook and export as either PDF or HTML. If the visualizations using altair are not being shown in the html, submit a separated version with altair html. Refer to: https://altair-viz.github.io/getting_started/starting.html#publishing-your-visualization (you can use the
chart.save('chart_file.html')method). - Submit to Canvas.
# Start YOUR CODE HERE
Discussion¶
Discuss briefly the results of the dimension reduction methods you applied. What do you observe? Do the reduced dimensions capture any structure of the data? How do the two methods compare? Are there any interesting patterns or clusters in the data that can be observed visually?
YOUR DISCUSSION HERE
Run in Google Colab
View on GitHub