Downloads · 30 days
0
Citynews/model_test
model_test is a machine learning model from Citynews. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This repository contains a PyTorch model for generating user embeddings based on DMP (Data Management Platform) data. The model creates dense vector representations of users that can be used for recommendation systems…
Downloads · 30 days
0
Access
Public
Updated Mar 14, 2025
Repo size
5.2 GB
Likes
0
Public
Click a slice to open those files.
.json4.6 GB · 100%
From the Hugging Face model README
This repository contains a PyTorch model for generating user embeddings based on DMP (Data Management Platform) data. The model creates dense vector representations of users that can be used for recommendation systems, user clustering, and similarity searches.
To run the model using Docker:
docker build -t user-embedding-model .
docker run -v /path/to/your/data:/app/data \
-e DATA_PATH=/app/data/users.json \
-e NUM_EPOCHS=10 \
-e BATCH_SIZE=32 \
-v /path/to/output:/app/embeddings_output \
user-embedding-model
To automatically push the model to Hugging Face, add your credentials:
docker run -v /path/to/your/data:/app/data \
-e DATA_PATH=/app/data/users.json \
-e HF_REPO_ID="your-username/your-model-name" \
-e HF_TOKEN="your-huggingface-token" \
-v /path/to/output:/app/embeddings_output \
user-embedding-model
The model expects user data in JSON format, with each user having DMP fields like:
{
"dmp": {
"city": "milano",
"domains": ["example.com"],
"brands": ["brand1", "brand2"],
"clusters": ["cluster1", "cluster2"],
"industries": ["industry1"],
"tags": ["tag1", "tag2"],
"channels": ["channel1"],
"~click__host": "host1",
"~click__domain": "domain1",
"": {
"id": "user123"
}
}
}
DATA_PATH: Path to your input JSON file (default: "users.json")NUM_EPOCHS: Number of training epochs (default: 10)BATCH_SIZE: Batch size for training (default: 32)LEARNING_RATE: Learning rate for optimizer (default: 0.001)SAVE_INTERVAL: Save checkpoint every N epochs (default: 2)HF_REPO_ID: Hugging Face repository ID for uploadingHF_TOKEN: Hugging Face API tokenThe model generates:
embeddings.json: User embeddings in JSON formatembeddings.npz: User embeddings in NumPy formatvocabularies.json: Vocabulary mappingsmodel.pth: Trained PyTorch modelmodel_config.json: Model configurationThe model consists of:
The code includes several optimizations:
If you encounter issues: