socioinfer is a containerized microservice system that infers a Twitter user's interests by analyzing their profile and social graph. It combines on-demand data syncing, graph-based storage (Neo4j), and NLP-driven interest extraction.
-
twitter-interest-inference(FastAPI + Python)- Extracts interests from user and followings' bios using NLP.
- Queries Neo4j directly for graph data.
- Triggers syncing via
NetworkSync.
-
NetworkSync(Express + TypeScript)- Syncs a user's Twitter followings from the Twitter API into Neo4j.
- Also supports and exposes APIs for mutual followings lookup and user graph storage.
-
Neo4j(Graph Database)- Stores users and their following relationships as a graph.
git clone --recurse-submodules https://github.com/pali101/SocioInfer.git
cd SocioInferEach service requires its own .env file.
For twitter interest inference:
cp ./twitter-interest-inference/.env.example ./twitter-interest-inference/.envFor network sync:
cp ./NetworkSync/.env.example ./NetworkSync/.envBoth services are containerized and orchestrated via Docker Compose. Start everything using Docker Compose:
docker-compose up --buildThis will launch all services, networked together and ready for API requests.
socioinfer/
├── NetworkSync/ # Submodule: Twitter data sync
├── twitter-interest-inference/ # Submodule: interest inference API
├── docker-compose.yml
└── README.md
- Backend: FastAPI (Python), Express (TypeScript)
- Database: Neo4j
- Containerization: Docker, Docker Compose
- NLP: Sentence Transformers
GET /interests/{username}: Returns inferred interests (optionally scored and model-selectable)
POST /api/sync: Syncs a user's Twitter followings into Neo4jPOST /api/user/store: Stores a user in the graphGET /api/mutual?user1=&user2=: Checks mutual followings between two users