Django Neural Feed (DNF) is an advanced Django app for creating tailored content feeds using semantic vector embeddings. By utilizing PostgreSQL's pgvector, it computes similarity seamlessly while offering customizable metrics for user engagement. DNF’s object-oriented architecture simplifies feed configurations and ensures robust performance whether in asynchronous or synchronous setups.
Django Neural Feed (DNF) is an innovative Django application that creates personalized content recommendation feeds utilizing advanced AI technology. By harnessing the power of PostgreSQL’s pgvector extension, DNF computes vector similarity directly within the database, integrating customizable metrics for content freshness and popularity into a streamlined SQL query.
With its object-oriented design, DNF allows for easy configuration through specialized Feed classes that maintain separation of logic and enhance maintainability. The framework monitors user interactions discreetly via Django signals while providing flexible deployment options, accommodating both asynchronous and synchronous execution to ensure robust performance under varying conditions.
BaseNeuralFeed class for clear organization and flexibility.UserFeedProfile model, enabling organized and scalable user interaction processing without cluttering the core Auth User table.Setup involves three simple steps to enable DNF in a Django project:
NeuralRecommendMixin to embed vector representation in content models.
from django.db import models
from django_neural_feed.mixins import NeuralRecommendMixin
class Post(NeuralRecommendMixin, models.Model):
title = models.CharField(max_length=255)
content = models.TextField()
from django_neural_feed.feeds import BaseNeuralFeed
class PostFeed(BaseNeuralFeed):
feed_id = "posts_main"
content_django_model = Post
.get_feed() method to retrieve curated recommendations.
feed_queryset = PostFeed.get_feed(user=request.user, queryset=Post.objects.all())
Django Neural Feed also includes capabilities for custom vector embeddings, allowing users to define their own text-to-vector encoders, adding flexibility for integrating with third-party APIs or cloud services. By default, it employs local embeddings via sentence-transformers, but can easily be adapted for various other implementations.
Django Neural Feed provides a comprehensive, powerful solution for personalizing content recommendations, making it an ideal addition to any Django application focused on enhancing user engagement through intelligent content delivery.
No comments yet.
Sign in to be the first to comment.