Project Info
This project did not submit a demo video on Devpost.
Inspiration
Twitter has become a primary channel for discovering what's happening in the world today. The way we express ourselves in those few characters can evoke different emotions that profoundly shape public discourse. Whether strategizing for your next presidential campaign or seeking to convey your next big idea, MediaPilot is your personal assistant to ensure your tweets are positively received by your intended audiences.
What it does
After drafting your tweet in the UI, MediaPilot performs analysis of the your draft by combining sentiment analysis with topic extraction. The NLP model is trained on your personal past Twitter data and runs a personal ML model on your draft to predict the number of likes and engagement your tweet would receive.
How we built it
React for frontend Python Flask for backend. NLTK library to conduct sentiment analysis and topic modeling. Scikit-learn for machine learning.
Challenges we ran into
We ran into challenges working with MindsDB. Unfortunately, due to syntax and computer compatibility issues, we were unable to use this product. We also attempted to use OpenAI's API for topic modeling. In the end, we decided against using the API because it didn't group the topics properly.
Accomplishments we're proud of
We're proud of the way we've been able to learn and experiment quickly with new technologies. For some of us, it was our first time using React and experimenting with new tools such as MindsDB and OpenAI's API. We built something that combined our interests in NLP and full-stack development, taking our software development skills to the next level. Overall, we enjoyed collaborating and bonding over creating this project.
What we learned
We learned how much fun it can be to build something we've never tried before and just keep learning along the way.
What's next
There are many exciting features that can be added, including recommendations of how to edit your tweet to make the words align better with your intended tone and mood. Furthermore, fine-tuning the model would improve the accuracy. Upgrading the database to cloud storage would allow for a greater training capacity of our models as well.
MediaPilot
Tips:
- DO NOT PUSH
datasets/TO GITHUB. IT'LL BE TOO MUCH TOO PUSH. - If you are importing a new library, just let Allen know :).
- To fetch an api route, call the
api()function.-
POSTmethods require a second argument (request) -
An example of
GETmethod fetched from React:fetch(api("/testget")) .then( response => response.json() // convert to json ).then( responseJSON => { /* some logic */ } ) -
An example of
POSTmethod fetched from React:let request = { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(echo) } fetch(api("/echo"), request) .then( res => res.json() ).then( response => response.json() // convert to json ).then( responseJSON => { /* some logic */ } )
-
- Frontend will use Material UI (https://mui.com/material-ui). Find pre-made components to use. in frontend. They also provide playground for you to change up the component, and you can copy paste into codebase.
- Twitter API is way too expensive. Instead, we will down pre-existing Twitter datasets (https://github.com/shaypal5/awesome-twitter-data) into
datasets/folder and train models from there.
Description of folders
- client/: contains the react frontend
- flask-server/: contains the Python backend
- nlp-model/: ALL work pertaining to NLP predictive models
- datasets/: stores all our datasets for building NLP application
Setup
git clone https://github.com/AllenCaoo/MediaPilot.git- Ensure:
Python >= 3.9 pip install -r requirements.txt(trypip3ifpipdoesn't work)cd clientnpm installcd ..cd nlp-servergit clone https://github.com/mindsdb/mindsdb.gitpython setup.py developpython -m mindsdb- Fin!
To run backend server:
cd flask-serverpython server.py(trypython3ifpythondoesn't work)- The Flask backend server will run on
http://localhost:5000
To run client
cd clientnpm start- The React frontend will run on
http://localhost:3000
Docker Setup:
docker run -p 47334:47334 -p 47335:47335 mindsdb/mindsdbhttp://127.0.0.1:47334/- Afterwards:
- powershell ->
wsl --shutdown
- powershell ->
Analysis
View
Metric
- 33
- 24
- 9
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- FlaskIn code
- HTMLIn code
- JavaScriptIn code
- PythonIn code
- ReactIn code
6 of 6 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
82 KB
Source files
43
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
AllenCaoo/MediaPilot
65 files · 108.7 MB · @ 362a11a
Structure
Interface
14 files · 22%Screens, components and styles rendered to the user.
Application logic
33 files · 51%Domain rules, services and shared utilities.
+1 more
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- JavaScript64%
- Python26%
- Markdown7%
- HTML2%
- CSS1%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
requirements.txt
pypi · 18- blinker
- click
- colorama
- Flask
- itsdangerous
- Jinja2
- joblib
- MarkupSafe
- nltk
- numpy
- pandas
- python-dateutil
- pytz
- regex
- six
- tqdm
- tzdata
- Werkzeug
client/package.json
npm · 15- @emotion/react
- @emotion/styled
- @mui/icons-material
- @mui/lab
- @mui/material
- @testing-library/jest-dom
- @testing-library/react
- @testing-library/user-event
- http-proxy-middleware
- react
- react-dom
- react-redux
- react-router-dom
- react-scripts
- web-vitals
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.