current position:Home>Information recommendation platform based on Python search engine and recommendation algorithm

Information recommendation platform based on Python search engine and recommendation algorithm

2022-02-02 06:41:58 z812483032

be based on Python Search engine and recommendation algorithm information recommendation platform

One 、 Preface

brief introduction

(1) adopt Python Regularly collect news data and obtain and analyze data sources , Use jieba Conduct text analysis , Calculate the similarity of the analyzed keywords , Get the relevance of the news , Recommend content through relevance . (2) Similarly, the user's IP Address area analysis , Then match the news content related to the user's region . (3) Then analyze and calculate the heat value through the amount of news reading and comments combined with the time point

Functional structure

 User side / The management end

frame 、 Third party Library

Technology involved / frame
front end Vue.js、iView、ElementUI、ECharts
Back end Django、Selenium、jieba、BeatifulSoup
database MySQL

Interface

 Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here

Two 、 Use steps

1. install Python rely on

The code is as follows :

pip install -r requirements.txt
#(requirements.txt The file has been included in the root directory of the source code )
 Copy code 

2. install Vue.js rely on

The front page is through Vue.js Compiling , It's using Vue Scaffolding ( Baidu installed it without )

npm install
 Copy code 

In the front page, the user side and the management side are two separate items , Therefore, you need to perform dependency installation under both projects !

3. Database creation / Data import

The database table is as follows  Insert picture description here SQL The file has been put in Django Project root directory , On their own Navicat Or other methods . remove Django Data table automatically generated by the framework , All that's left 13 A watch , It's too much trouble to add foreign key dependencies , So it may not be standardized . And for the first time Django To do the project , So for ORM I'm not familiar with the operation of , So that the subsequent multi table query can only be split into single table query , Mainly because Django The multi table query of requires intermediate tables as auxiliary operations , But when I was working on this project , The database has already been established , And the reptile part has been written , The relationship between time and time will not be overturned and reopened .

4. Database configuration

Use global search to find mysql You can find where you need configuration data . Because the whole framework is scattered and not synchronized in the same period , The configuration of the database is somewhat fragmented QAQ.....

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'news',
        'USER': 'root',
        'PASSWORD': 'root',
        'HOST': '127.0.0.1',
        'PORT': '3306',
    }
}
 Copy code 

5. Start project

Django Project start

#  Get into newsapi The catalog of 
python manage.py runserver 0.0.0.0:8000
 Copy code 

Vue Project start

// User side 
npm run dev 
// The management end 
npm run serve
 Copy code 

summary

On the whole, the completion degree of this project is relatively high , There are still Bug The two system controllers at the management end fail to brake from time to time , This is essentially because after the thread starts , For the control of task management, you can only cancel the interval task , But you can't close the thread directly . Another document is the structure of the project, which sounds chaotic , Find time to rearrange . The source code of the project has been updated , You can download it if you need it Welcome to submit questions and errors

Personal code cloud homepage , Welcome to exchange !!

copyright notice
author[z812483032],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/02/202202020641553438.html

Random recommended