'+a.addText+" "),k=c.find("tr:last a")):(d.filter(":last").after('"),k=d.filter(":last").next().find("a")));k.click(function(c){c.preventDefault();c=b("#"+a.prefix+"-empty");
6 | var d=c.clone(!0);d.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id",a.prefix+"-"+l);d.is("tr")?d.children(":last").append('"):d.is("ul")||d.is("ol")?d.append(''+a.deleteText+" "):d.children(":first").append(''+a.deleteText+" ");d.find("*").each(function(){e(this,a.prefix,f.val())});d.insertBefore(b(c));
7 | b(f).val(parseInt(f.val(),10)+1);l+=1;""!==h.val()&&0>=h.val()-f.val()&&k.parent().hide();d.find("a."+a.deleteCssClass).click(function(c){c.preventDefault();d.remove();--l;a.removed&&a.removed(d);b(document).trigger("formset:removed",[d,a.prefix]);c=b("."+a.formCssClass);b("#id_"+a.prefix+"-TOTAL_FORMS").val(c.length);(""===h.val()||0 tr").tabularFormset(a.options)}})})})(django.jQuery);
14 |
--------------------------------------------------------------------------------
/static/admin/js/jquery.init.js:
--------------------------------------------------------------------------------
1 | /*global django:true, jQuery:false*/
2 | /* Puts the included jQuery into our own namespace using noConflict and passing
3 | * it 'true'. This ensures that the included jQuery doesn't pollute the global
4 | * namespace (i.e. this preserves pre-existing values for both window.$ and
5 | * window.jQuery).
6 | */
7 | var django = django || {};
8 | django.jQuery = jQuery.noConflict(true);
9 |
--------------------------------------------------------------------------------
/static/admin/js/popup_response.js:
--------------------------------------------------------------------------------
1 | /*global opener */
2 | (function() {
3 | 'use strict';
4 | var initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse);
5 | switch(initData.action) {
6 | case 'change':
7 | opener.dismissChangeRelatedObjectPopup(window, initData.value, initData.obj, initData.new_value);
8 | break;
9 | case 'delete':
10 | opener.dismissDeleteRelatedObjectPopup(window, initData.value);
11 | break;
12 | default:
13 | opener.dismissAddRelatedObjectPopup(window, initData.value, initData.obj);
14 | break;
15 | }
16 | })();
17 |
--------------------------------------------------------------------------------
/static/admin/js/prepopulate.js:
--------------------------------------------------------------------------------
1 | /*global URLify*/
2 | (function($) {
3 | 'use strict';
4 | $.fn.prepopulate = function(dependencies, maxLength, allowUnicode) {
5 | /*
6 | Depends on urlify.js
7 | Populates a selected field with the values of the dependent fields,
8 | URLifies and shortens the string.
9 | dependencies - array of dependent fields ids
10 | maxLength - maximum length of the URLify'd string
11 | allowUnicode - Unicode support of the URLify'd string
12 | */
13 | return this.each(function() {
14 | var prepopulatedField = $(this);
15 |
16 | var populate = function() {
17 | // Bail if the field's value has been changed by the user
18 | if (prepopulatedField.data('_changed')) {
19 | return;
20 | }
21 |
22 | var values = [];
23 | $.each(dependencies, function(i, field) {
24 | field = $(field);
25 | if (field.val().length > 0) {
26 | values.push(field.val());
27 | }
28 | });
29 | prepopulatedField.val(URLify(values.join(' '), maxLength, allowUnicode));
30 | };
31 |
32 | prepopulatedField.data('_changed', false);
33 | prepopulatedField.change(function() {
34 | prepopulatedField.data('_changed', true);
35 | });
36 |
37 | if (!prepopulatedField.val()) {
38 | $(dependencies.join(',')).keyup(populate).change(populate).focus(populate);
39 | }
40 | });
41 | };
42 | })(django.jQuery);
43 |
--------------------------------------------------------------------------------
/static/admin/js/prepopulate.min.js:
--------------------------------------------------------------------------------
1 | (function(c){c.fn.prepopulate=function(e,f,g){return this.each(function(){var a=c(this),b=function(){if(!a.data("_changed")){var b=[];c.each(e,function(a,d){d=c(d);01&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ca.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/cs.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím zadejte o jeden znak méně":n<=4?"Prosím zadejte o "+e(n,!0)+" znaky méně":"Prosím zadejte o "+n+" znaků méně"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím zadejte ještě jeden znak":n<=4?"Prosím zadejte ještě další "+e(n,!0)+" znaky":"Prosím zadejte ještě dalších "+n+" znaků"},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky":"Můžete zvolit maximálně "+n+" položek"},noResults:function(){return"Nenalezeny žádné položky"},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/da.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Angiv venligst "+t+" tegn mindre";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Angiv venligst "+t+" tegn mere";return n},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/de.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/el.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Παρακαλώ διαγράψτε "+t+" χαρακτήρ";return t==1&&(n+="α"),t!=1&&(n+="ες"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Παρακαλώ συμπληρώστε "+t+" ή περισσότερους χαρακτήρες";return n},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(e){var t="Μπορείτε να επιλέξετε μόνο "+e.maximum+" επιλογ";return e.maximum==1&&(t+="ή"),e.maximum!=1&&(t+="ές"),t},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/en.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/es.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"La carga falló"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/et.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/eu.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/fa.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها میتوانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجهای یافت نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/fi.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/fr.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Supprimez "+t+" caractère";return t!==1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Saisissez "+t+" caractère";return t!==1&&(n+="s"),n},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){var t="Vous pouvez seulement sélectionner "+e.maximum+" élément";return e.maximum!==1&&(t+="s"),t},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/gl.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Elimine ";return t===1?n+="un carácter":n+=t+" caracteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Engada ";return t===1?n+="un carácter":n+=t+" caracteres",n},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){var t="Só pode ";return e.maximum===1?t+="un elemento":t+=e.maximum+" elementos",t},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/he.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק ";return t===1?n+="תו אחד":n+=t+" תווים",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס ";return t===1?n+="תו אחד":n+=t+" תווים",n+=" או יותר",n},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור עד ";return e.maximum===1?t+="פריט אחד":t+=e.maximum+" פריטים",t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/hi.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/hr.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/hu.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/id.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/is.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/it.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ja.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除してください";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="少なくとも "+t+" 文字を入力してください";return n},loadingMore:function(){return"読み込み中…"},maximumSelected:function(e){var t=e.maximum+" 件しか選択できません";return t},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/km.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="សូមលុបចេញ "+t+" អក្សរ";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="សូមបញ្ចូល"+t+" អក្សរ រឺ ច្រើនជាងនេះ";return n},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(e){var t="អ្នកអាចជ្រើសរើសបានតែ "+e.maximum+" ជម្រើសប៉ុណ្ណោះ";return t},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ko.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/lt.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%10===1&&(e%100<11||e%100>19)?t:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"į","ius","ių"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"į","ius","ių"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ą","us","ų"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/lv.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/mk.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ms.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Sila hapuskan "+t+" aksara"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Sila masukkan "+t+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(e){return"Anda hanya boleh memilih "+e.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/nb.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vennligst skriv inn ";return t>1?n+=" flere tegn":n+=" tegn til",n},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/nl.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t=e.maximum==1?"kan":"kunnen",n="Er "+t+" maar "+e.maximum+" item";return e.maximum!=1&&(n+="s"),n+=" worden geselecteerd",n},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/pl.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Usuń "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maximum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/pt-BR.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/pt.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"carácter",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ro.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return t!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceți "+t+"sau mai multe caractere";return n},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",e.maximum!==1&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/ru.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите еще хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/sk.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte ešte jeden znak":n<=4?"Prosím, zadajte ešte ďalšie "+e[n](!0)+" znaky":"Prosím, zadajte ešte ďalších "+n+" znakov"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){return t.maximum==1?"Môžete zvoliť len jednu položku":t.maximum>=2&&t.maximum<=4?"Môžete zvoliť najviac "+e[t.maximum](!1)+" položky":"Môžete zvoliť najviac "+t.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/sr-Cyrl.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr-Cyrl",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Обришите "+n+" симбол";return r+=e(n,"","а","а"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Укуцајте бар још "+n+" симбол";return r+=e(n,"","а","а"),r},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(t){var n="Можете изабрати само "+t.maximum+" ставк";return n+=e(t.maximum,"у","е","и"),n},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/sr.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/sv.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/th.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออก "+t+" ตัวอักษร";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีก "+t+" ตัวอักษร";return n},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือกได้ไม่เกิน "+e.maximum+" รายการ";return t},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/tr.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/uk.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь ласка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь ласка, введіть "+t+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/vi.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng nhập ít hơn "+t+" ký tự";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập nhiều hơn "+t+' ký tự"';return n},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(e){var t="Chỉ có thể chọn được "+e.maximum+" lựa chọn";return t},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/zh-CN.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/select2/i18n/zh-TW.js:
--------------------------------------------------------------------------------
1 | /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
2 |
3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="請再輸入"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="你只能選擇最多"+e.maximum+"項";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"}}}),{define:e.define,require:e.require}})();
--------------------------------------------------------------------------------
/static/admin/js/vendor/xregexp/LICENSE-XREGEXP.txt:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2007-2012 Steven Levithan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/static/css/aboutUS.css:
--------------------------------------------------------------------------------
1 | @font-face
2 | {
3 | font-family: spFont;
4 | src: url(../font/fz.TTF);
5 | }
6 | .main{
7 | /*box-shadow: 5px 5px 2px 0px rgba(29,42,114,0.15);*/
8 | background-size: 100% 100%;
9 | background-repeat: no-repeat;
10 | }
11 |
12 | .main_title{
13 | width: 74px;
14 | height: 57px;
15 | /* margin-top: 94px; */
16 | padding-top: 14px;
17 | margin: auto;
18 | text-align: center;
19 | }
20 |
--------------------------------------------------------------------------------
/static/css/articleAnalyze.css:
--------------------------------------------------------------------------------
1 |
2 | .main{
3 | background-size: 100% 100%;
4 | background-repeat: no-repeat;
5 | }
6 | @font-face
7 | {
8 | font-family: spFont;
9 | src: url(../font/fz.TTF);
10 | }
11 |
12 | .textarea{
13 | padding-top: 50px;
14 | }
15 | textarea{
16 | height: 310px;
17 | width:86%;
18 | margin-left: 7%;
19 | resize: none;
20 | outline: none;
21 | border: none;
22 | }
23 |
24 | .button{
25 | height: 31px;
26 | width: 112px;
27 | border: none;
28 | margin-top: 70px;
29 | margin-left: 87px;
30 | }
31 |
32 | .tag{
33 | margin-top: 50px;
34 | margin-left: 135px;
35 | }
36 | .tag ul li{
37 | list-style: none;
38 | float: left;
39 | font-size: 30px;
40 | margin-left: 25px;
41 | font-family: spFont;
42 | color: #282c80;
43 | font-weight: bold;
44 | }
--------------------------------------------------------------------------------
/static/css/hotNews.css:
--------------------------------------------------------------------------------
1 | @font-face
2 | {
3 | font-family: spFont;
4 | src: url(../font/fz.TTF);
5 | }
6 | .main .info_list li{
7 | list-style: none;
8 | width: 80%;
9 | }
10 | .page{
11 | float: left;
12 | width: 15px;
13 | margin-left: 5px;
14 |
15 | }
16 | .page a{
17 | text-decoration: none;
18 | }
19 |
20 | .main_window_top{
21 | padding-top: 35px;
22 | width: 98%;;
23 | font-family: spFont;
24 | }
25 | .news_title{
26 | margin-left: 50px;
27 | font-size: 25px;
28 | color: red;
29 | }
30 | .classify{
31 | margin-left: 40%;
32 | font-size: 25px;
33 | color: blue;
34 | }
35 | .info_classify {
36 | /*float: right;*/
37 | margin-left: 18%;
38 | }
39 | .line{
40 | width: 100%;
41 | background-repeat: no-repeat;
42 | background-size: 100% 100%;
43 | clip: rect(0, 0 ,50px, 50px);
44 | }
45 |
46 | .info_list{
47 | margin-top: 50px;
48 | width: 98%;
49 | }
50 | .info_list li{
51 | margin-top: 18px;
52 | font-size: 18px;
53 | width: 1608px;
54 | font-family: spFont;
55 | }
56 |
57 | .info_list li a{
58 | margin-left: 40px;
59 | display:inline-block;
60 | width:500px;
61 | }
62 |
63 | .main{
64 | margin-top: 80px;
65 | margin-left: 5%;
66 | height: 640px;
67 | width: 91%;
68 |
69 | }
70 |
71 | .pagination{
72 | padding: 0px;
73 | list-style: none;
74 | width: 270px;
75 | height: 30px;
76 | margin:0 auto;
77 | }
78 |
79 | .pagination li a{
80 | font-size: 18px;
81 | }
82 | /*.info_block {*/
83 | /*text-align: center;*/
84 | /*width: 600px;*/
85 | /*margin: 45px auto;*/
86 | /*}*/
87 |
88 |
89 | .pageone{
90 | width:100%;
91 | height: 30px;
92 | }
93 |
94 | .time{
95 | margin-left: 300px;
96 | font-size: 25px;
97 | color: blue;
98 | }
99 | .info_time{
100 | margin-left: 290px;
101 | }
--------------------------------------------------------------------------------
/static/css/main.css:
--------------------------------------------------------------------------------
1 | body{
2 | margin-top: 0px;
3 | background-color: #ebebeb;
4 | margin: auto;
5 | width: 100%;
6 | max-width: 1920px;
7 | min-width: 1600px;
8 | }
9 |
10 | .banner{
11 | margin: auto;
12 | height: 640px;
13 | width: 100%;
14 | background-repeat: no-repeat;
15 | background-position:center top;
16 | }
17 |
18 | .logo{
19 | font-size: 24px;
20 | color: white;
21 | font-family: Gadugi;
22 | margin-left: 2.604%;
23 | padding-top: 5px;
24 | }
25 | .address{
26 | margin-top: -25px;
27 | margin-left: 92.7%;
28 | font-size: 16px;
29 | color: white;
30 | font-family: Gadugi;
31 | }
32 |
33 | .Category{
34 | margin-top: 25px;
35 | margin-left: 2.604%;
36 | height: 24px;
37 | width: 26px;
38 | background-size: 24px 26px;
39 | }
40 | .nav{
41 | float: left;
42 | margin-top: -39px;
43 | }
44 | .nav ul li{
45 | font-family: 微软雅黑;
46 | list-style: none;
47 | float: left;
48 | color: white;
49 | font-size: 22px;
50 | margin-left: 70px;
51 | }
52 |
53 | .nav ul li a{
54 | color: white;
55 | text-decoration: none;
56 | }
57 | .nav ul li a:hover {
58 | color: #c8c8c8;
59 | }
60 |
61 | .navigationBar2{
62 | margin-top: 453px;
63 | width: 1000px;
64 | height: 200px;
65 | margin: 453px auto;
66 | }
67 |
68 | .nav2_1{
69 | float: left;
70 | margin-left: 65px;
71 | }
72 | .nav2_2{
73 | float: left;
74 | margin-left: 132px;
75 | }
76 |
77 | .nav2_3{
78 | float: left;
79 | margin-left: 117px;
80 | }
81 | .nav_2_1_1{
82 | font-size: 24px;
83 | color: #fff;
84 | font-family: 微软雅黑;
85 | }
86 | .nav_2_1_2{
87 | margin-top: -17px;
88 | font-size: 16px;
89 | color: #fff;
90 | font-family: 黑体;
91 | }
92 | .main{
93 | margin: 80px auto;
94 | height: 640px;
95 | width: 91%;
96 | background-color: white;
97 | box-shadow: 5px 5px 2px 0px rgba(29,42,114,0.15);
98 | }
99 | .foot{
100 | margin-top: 80px;
101 | height: 150px;
102 | /*border:1px solid red;*/
103 | width: 800px;
104 | margin: auto;
105 | }
106 |
107 |
108 |
109 | .foot p{
110 | text-align: center;
111 | }
112 |
113 | .foot_1{
114 | margin-top: 50px;
115 | text-align: center;
116 |
117 | }
118 |
119 | .foot_1 a{
120 | text-decoration: none;
121 | }
--------------------------------------------------------------------------------
/static/css/main_back.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/static/css/main_back.css
--------------------------------------------------------------------------------
/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/static/favicon.ico
--------------------------------------------------------------------------------
/static/font/fz.TTF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/static/font/fz.TTF
--------------------------------------------------------------------------------
/static/imgs/Category.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/static/imgs/Category.png
--------------------------------------------------------------------------------
/static/imgs/aboutUS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/static/imgs/aboutUS.png
--------------------------------------------------------------------------------
/static/imgs/banner_about_us.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/static/imgs/banner_about_us.png
--------------------------------------------------------------------------------
/static/imgs/banner_atricle_analyzie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/static/imgs/banner_atricle_analyzie.png
--------------------------------------------------------------------------------
/static/imgs/banner_hot_news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/static/imgs/banner_hot_news.png
--------------------------------------------------------------------------------
/static/imgs/button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/static/imgs/button.png
--------------------------------------------------------------------------------
/static/imgs/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/static/imgs/line.png
--------------------------------------------------------------------------------
/static/imgs/wenzi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/static/imgs/wenzi.png
--------------------------------------------------------------------------------
/templates/aboutUS.html:
--------------------------------------------------------------------------------
1 |
2 | {% load static %}
3 |
4 |
5 |
6 | {% block title %} About Us {% endblock %}
7 |
8 |
10 |
40 |
41 |
42 |
43 | {% block mycss %}
44 |
45 | {% endblock %}
46 |
47 |
48 | {% block banner %}
49 |
50 |
51 |
基于卷积神经网络的在线新闻分类系统
52 |
陕西·延安
53 |
54 |
64 |
65 |
66 |
关于我们
67 |
人工智能 让世界更美好
68 |
69 |
70 |
热点新闻
71 |
挖掘潜在价值 探析内在奥秘
72 |
73 |
74 |
洞悉文字
75 |
洞悉情感世界 探索语言真谛
76 |
77 |
78 |
79 |
80 | {% endblock %}
81 |
82 | {% block window %}
83 |
84 |
85 |
关于我们
86 |
ABOUT US
87 |
88 |
89 |
团队简介:延安大学三人组是一支由拥有UI、前段、后台开发组等能力的同学组成的创新创业团队,三名同学均来自于延安大学数学与计算机科学学院,我们在专业素养和思想素养上都对自己有着严格的要求。本次参赛目标旨在锻炼自我,培养团队创业精神。
90 |
团队意义:发扬延安精神,努力拼搏向上,结合所学知识,进行实践创新,不断储备知识技能,不断丰富人生阅历。
91 |
92 |
93 |
项目简介:关于NLP(自然语言处理)技术的新闻分类系统和文字分析系统项目是为了提高新闻 质量和减少新闻重复率而创立的项目。项目主要技术采用神经网络,其算法具有学习规则简单及强大的学习能力的优点,从而使系统具有良好的稳定性和准确性。系统分为两个子功能——新闻热点和洞悉文字,新闻热点主要为用户提供简单明了的新闻浏览品台,用户按照系统分类来选择当前的热点新闻;洞悉文字做为模型的扩展功能,用户可自行输入文字,系统将会分析出文字的内容分类,并呈现给用户。
94 |
95 |
96 |
97 | {% endblock %}
98 |
99 |
100 |
101 |
117 |
118 |
119 |
120 | {% block myjs %}
121 |
122 | {% endblock %}
--------------------------------------------------------------------------------
/templates/articleAnalyze.html:
--------------------------------------------------------------------------------
1 | {% extends 'aboutUS.html' %}
2 | {% load static %}
3 | {% block title %} Article Analyze{% endblock %}
4 | {% block mycss %}
5 |
6 | {% endblock %}
7 |
8 | {% block banner %}
9 |
10 |
11 |
基于卷积神经网络的在线新闻分类系统
12 |
陕西·延安
13 |
14 |
25 |
26 |
27 |
关于我们
28 |
人工智能 让世界更美好
29 |
30 |
31 |
热点新闻
32 |
挖掘潜在价值 探析内在奥秘
33 |
34 |
35 |
洞悉文字
36 |
洞悉情感世界 探索语言真谛
37 |
38 |
39 |
40 |
41 |
42 | {% endblock %}
43 |
44 | {% block window %}
45 |
46 |
59 |
72 |
73 | {# 这里循环输出先调整好#}
74 |
75 |
76 | {% for foo in classify %}
77 | {{ foo }}
78 | {% endfor %}
79 |
80 |
81 |
82 |
83 |
84 |
85 | {% endblock %}
86 | {% block myjs %}
87 |
89 | {% endblock %}
--------------------------------------------------------------------------------
/templates/hotNews.html:
--------------------------------------------------------------------------------
1 | {% extends 'aboutUS.html' %}
2 | {% load static %}
3 | {% block title %} Hot News{% endblock %}
4 | {% block mycss %}
5 |
6 | {% endblock %}
7 | {% block banner %}
8 |
9 |
10 |
基于卷积神经网络的在线新闻分类系统
11 |
陕西·延安
12 |
13 |
23 |
24 |
25 |
关于我们
26 |
人工智能 让世界更美好
27 |
28 |
29 |
热点新闻
30 |
挖掘潜在价值 探析内在奥秘
31 |
32 |
33 |
洞悉文字
34 |
洞悉情感世界 探索语言真谛
35 |
36 |
37 |
38 |
39 |
40 | {% endblock %}
41 |
42 | {% block window %}
43 |
44 |
45 |
新闻热点 类别 时间
46 |
47 | {% for item in cus_list %}
48 | {{ item.title }} {{ item.classify }} {{ item.time }}
49 |
50 | {% endfor %}
51 |
52 |
53 |
54 |
83 |
84 |
85 |
86 | {% endblock %}
87 |
--------------------------------------------------------------------------------
/text_classification.sql:
--------------------------------------------------------------------------------
1 | /*
2 | Navicat MySQL Data Transfer
3 |
4 | Source Server : classification
5 | Source Server Version : 50721
6 | Source Host : 47.98.96.189:3306
7 | Source Database : text_classification
8 |
9 | Target Server Type : MYSQL
10 | Target Server Version : 50721
11 | File Encoding : 65001
12 |
13 | Date:UTC+3 2020-05-11 09:01:19
14 | */
15 |
16 | SET FOREIGN_KEY_CHECKS=0;
17 |
18 | -- ----------------------------
19 | -- Table structure for news_classify
20 | -- ----------------------------
21 | DROP TABLE IF EXISTS `news_classify`;
22 | CREATE TABLE `news_classify` (
23 | `classify_id` int(11) NOT NULL AUTO_INCREMENT,
24 | `classify` varchar(10) CHARACTER SET utf8 DEFAULT NULL,
25 | PRIMARY KEY (`classify_id`)
26 | ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
27 |
28 | -- insert classified_dictionary
29 | INSERT INTO `text_classification`.`news_classify` (`classify_id`, `classify`) VALUES ('1', '体育'),('2', '财经'),('3', '房产'),('4','家居'),('5','教育'),('6','科技'),('7','时尚'),('8','时政'),('9','游戏'),('10','娱乐'),('11','股票'),('12','彩票'),('13','社会')
30 | ,('14','星座');
31 |
32 | -- ----------------------------
33 | -- Table structure for wangyi_news
34 | -- ----------------------------
35 | DROP TABLE IF EXISTS `wangyi_news`;
36 | CREATE TABLE `wangyi_news` (
37 | `news_id` int(11) NOT NULL AUTO_INCREMENT,
38 | `news_title` varchar(600) CHARACTER SET utf8 DEFAULT NULL,
39 | `news_url` varchar(600) DEFAULT NULL,
40 | `news_article` longtext CHARACTER SET utf8,
41 | `insert_time` varchar(11) DEFAULT NULL,
42 | PRIMARY KEY (`news_id`)
43 | ) ENGINE=InnoDB AUTO_INCREMENT=2627 DEFAULT CHARSET=latin1;
44 |
45 | -- ----------------------------
46 | -- Table structure for wangyi_news_classify
47 | -- ----------------------------
48 | DROP TABLE IF EXISTS `wangyi_news_classify`;
49 | CREATE TABLE `wangyi_news_classify` (
50 | `id` int(11) NOT NULL AUTO_INCREMENT,
51 | `news_id` int(11) DEFAULT NULL,
52 | `classify_id` int(11) DEFAULT NULL,
53 | PRIMARY KEY (`id`),
54 | KEY `wangyi_news_classify_ibfk_1` (`news_id`),
55 | KEY `wangyi_news_classify_ibfk_2` (`classify_id`),
56 | CONSTRAINT `wangyi_news_classify_ibfk_1` FOREIGN KEY (`news_id`) REFERENCES `wangyi_news` (`news_id`),
57 | CONSTRAINT `wangyi_news_classify_ibfk_2` FOREIGN KEY (`classify_id`) REFERENCES `news_classify` (`classify_id`)
58 | ) ENGINE=InnoDB AUTO_INCREMENT=2776 DEFAULT CHARSET=latin1;
59 |
60 | -- ----------------------------
61 | -- View structure for view_news_classify
62 | -- ----------------------------
63 | DROP VIEW IF EXISTS `view_news_classify`;
64 | CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `view_news_classify` AS select `wangyi_news_classify`.`news_id` AS `news_id`,`wangyi_news`.`news_title` AS `news_title`,`wangyi_news`.`news_url` AS `news_url`,`wangyi_news`.`insert_time` AS `insert_time`,`news_classify`.`classify` AS `classify` from ((`wangyi_news` join `news_classify`) join `wangyi_news_classify`) where ((`wangyi_news`.`news_id` = `wangyi_news_classify`.`news_id`) and (`news_classify`.`classify_id` = `wangyi_news_classify`.`classify_id`)) order by `wangyi_news`.`insert_time` desc ;
65 |
--------------------------------------------------------------------------------
/text_classification/.idea/dictionaries/danda.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/text_classification/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/text_classification/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/text_classification/.idea/text_classification.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/text_classification/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 dzkang
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/text_classification/__pycache__/client.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/__pycache__/client.cpython-36.pyc
--------------------------------------------------------------------------------
/text_classification/__pycache__/cnn_model.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/__pycache__/cnn_model.cpython-36.pyc
--------------------------------------------------------------------------------
/text_classification/__pycache__/connect_mysql.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/__pycache__/connect_mysql.cpython-36.pyc
--------------------------------------------------------------------------------
/text_classification/__pycache__/wangyinews_crawler.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/__pycache__/wangyinews_crawler.cpython-36.pyc
--------------------------------------------------------------------------------
/text_classification/checkpoints/textcnn/best_validation.data-00000-of-00001:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/checkpoints/textcnn/best_validation.data-00000-of-00001
--------------------------------------------------------------------------------
/text_classification/checkpoints/textcnn/best_validation.index:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/checkpoints/textcnn/best_validation.index
--------------------------------------------------------------------------------
/text_classification/checkpoints/textcnn/best_validation.meta:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/checkpoints/textcnn/best_validation.meta
--------------------------------------------------------------------------------
/text_classification/checkpoints/textcnn/checkpoint:
--------------------------------------------------------------------------------
1 | model_checkpoint_path: "best_validation"
2 | all_model_checkpoint_paths: "best_validation"
3 |
--------------------------------------------------------------------------------
/text_classification/client.py:
--------------------------------------------------------------------------------
1 | from socket import *
2 |
3 |
4 | def send_info(senddata):
5 | address='127.0.0.1' #服务器的ip地址
6 | port=12345 #服务器的端口号
7 | buffsize=8192 #接收数据的缓存大小
8 | s = socket(AF_INET, SOCK_STREAM)
9 | s.connect((address,port))
10 | s.send(senddata.encode())
11 | recvdata=s.recv(buffsize).decode('utf-8')
12 | s.close()
13 | return recvdata
14 |
--------------------------------------------------------------------------------
/text_classification/cnn_model.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | import tensorflow as tf
4 |
5 |
6 | class TCNNConfig(object):
7 | """CNN配置参数"""
8 |
9 | embedding_dim = 64 # 词向量维度
10 | seq_length = 600 # 序列长度
11 | num_classes = 14 # 类别数
12 | num_filters = 512 # 卷积核数目
13 | kernel_size = 9 # 卷积核尺寸
14 | vocab_size = 6000 # 词汇表达小
15 |
16 | hidden_dim = 128 # 全连接层神经元
17 |
18 | dropout_keep_prob = 0.6 # dropout保留比例
19 | learning_rate = 1e-3 # 学习率
20 |
21 | batch_size = 128 # 每批训练大小
22 | num_epochs = 10 # 总迭代轮次
23 |
24 | print_per_batch = 1000 # 每多少轮输出一次结果
25 | save_per_batch = 10 # 每多少轮存入tensorboard
26 |
27 |
28 | class TextCNN(object):
29 | """文本分类,CNN模型"""
30 |
31 | def __init__(self, config):
32 | self.config = config
33 |
34 | # 三个待输入的数据
35 | self.input_x = tf.placeholder(tf.int32, [None, self.config.seq_length], name='input_x')
36 | self.input_y = tf.placeholder(tf.float32, [None, self.config.num_classes], name='input_y')
37 | self.keep_prob = tf.placeholder(tf.float32, name='keep_prob')
38 |
39 | self.cnn()
40 |
41 | def cnn(self):
42 | """CNN模型"""
43 | # 词向量映射
44 | with tf.device('/cpu:0'):
45 | embedding = tf.get_variable('embedding', [self.config.vocab_size, self.config.embedding_dim])
46 | embedding_inputs = tf.nn.embedding_lookup(embedding, self.input_x)
47 |
48 | with tf.name_scope("cnn"):
49 | # CNN layer
50 | conv = tf.layers.conv1d(embedding_inputs, self.config.num_filters, self.config.kernel_size, name='conv')
51 | # global max pooling layer
52 | gmp = tf.reduce_max(conv, reduction_indices=[1], name='gmp')
53 |
54 | with tf.name_scope("score"):
55 | # 全连接层,后面接dropout以及relu激活
56 | fc = tf.layers.dense(gmp, self.config.hidden_dim, name='fc1')
57 | fc = tf.contrib.layers.dropout(fc, self.keep_prob)
58 | fc = tf.nn.relu(fc)
59 |
60 | # 分类器
61 | self.logits = tf.layers.dense(fc, self.config.num_classes, name='fc2')
62 | self.y_pred_cls = tf.argmax(tf.nn.softmax(self.logits), 1) # 预测类别
63 |
64 | with tf.name_scope("optimize"):
65 | # 损失函数,交叉熵
66 | cross_entropy = tf.nn.softmax_cross_entropy_with_logits(logits=self.logits, labels=self.input_y)
67 | self.loss = tf.reduce_mean(cross_entropy)
68 | # 优化器
69 | self.optim = tf.train.AdamOptimizer(learning_rate=self.config.learning_rate).minimize(self.loss)
70 |
71 | with tf.name_scope("accuracy"):
72 | # 准确率
73 | correct_pred = tf.equal(tf.argmax(self.input_y, 1), self.y_pred_cls)
74 | self.acc = tf.reduce_mean(tf.cast(correct_pred, tf.float32))
75 |
--------------------------------------------------------------------------------
/text_classification/connect_mysql.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # encoding: utf-8
4 |
5 | '''
6 |
7 | @author: Zhao Chi
8 |
9 | @contact: Vectors@aliyun.com
10 |
11 | @software: PyCharm
12 |
13 | @file: connect_mysql.py
14 |
15 | @time: 2018/4/10 0:13
16 |
17 | @desc:
18 |
19 | '''
20 | # 导入:
21 | from sqlalchemy import Column, create_engine, ForeignKey
22 | from sqlalchemy.types import String,Integer,VARCHAR,TEXT
23 | from sqlalchemy.orm import sessionmaker
24 | from sqlalchemy.ext.declarative import declarative_base
25 | # 创建对象的基类:
26 | Base = declarative_base()
27 |
28 |
29 | # 定义表对象:
30 | class wangyi_news(Base):
31 | '''
32 | wangyi_news:存放爬虫爬取的数据
33 | '''
34 | # 表的名字:
35 | __tablename__ = 'wangyi_news'
36 | # 表的结构:
37 | news_id = Column(Integer, primary_key=True)
38 | news_title = Column(VARCHAR(600))
39 | news_url = Column(VARCHAR(600))
40 | news_article = Column(TEXT)
41 | insert_time = Column(VARCHAR(11))
42 |
43 |
44 | class news_classify(Base):
45 | '''
46 | news_classify:存放新闻的种类以及新闻id,固定的,不更新
47 | '''
48 | # 表的名字
49 | __tablename__ = 'news_classify'
50 | # 表的结构
51 | classify_id = Column(Integer, primary_key=True)
52 | classify = Column(VARCHAR(10))
53 |
54 |
55 | class wangyi_news_classify(Base):
56 | '''
57 | wangyi_news_classify:存放经过程序分类后的结果
58 | '''
59 | __tablename__ = 'wangyi_news_classify'
60 | id = Column(Integer, primary_key=True)
61 | news_id = Column(Integer, ForeignKey(wangyi_news.news_id)) # 外键
62 | classify_id = Column(Integer, ForeignKey(news_classify.classify_id)) # 外键
63 |
64 |
65 | # 定义视图
66 | class view_news_classify(Base):
67 | '''
68 | view_news_classify:通过以下sql语句
69 | create view view_news_classify AS
70 | select wangyi_news_classify.news_id,news_title,news_url,insert_time,classify
71 | from wangyi_news,news_classify,wangyi_news_classify
72 | where wangyi_news.news_id = wangyi_news_classify.news_id
73 | and news_classify.classify_id = wangyi_news_classify.classify_id
74 | order by insert_time desc
75 | 创建的视图
76 | '''
77 | # 视图名字
78 | __tablename__ = 'view_news_classify'
79 | # 视图结构
80 | news_id = Column(Integer, primary_key=True)
81 | news_title = Column(VARCHAR(600))
82 | insert_time = Column(VARCHAR(11))
83 | classify = Column(VARCHAR(10))
84 | news_url = Column(VARCHAR(600))
85 |
86 |
87 |
88 | # 定义字典 加快读取速度
89 | classify_dict = {
90 |
91 | '体育': 1,
92 | '财经': 2,
93 | '房产': 3,
94 | '家居': 4,
95 | '教育': 5,
96 | '科技': 6,
97 | '时尚': 7,
98 | '时政': 8,
99 | '游戏': 9,
100 | '娱乐': 10,
101 | '股票': 11,
102 | '彩票': 12,
103 | '社会': 13,
104 | '星座': 14
105 | }
106 |
107 | engine = create_engine('mysql+mysqlconnector://root:password@xx.xx.xx.xx/text_classification')
108 | # 创建DBSession类型:
109 | DBSession = sessionmaker(bind=engine)
110 |
111 | def insert_wangyinews_into_mysql(table_name, news_title, news_url, news_article, insert_time):
112 | '''
113 |
114 | :param table_name:表名
115 | :param news_title:新闻标题
116 | :param news_url:新闻地址
117 | :param news_article:新闻文章内容
118 | :param insert_time:将新闻插入数据库的时间
119 | :return:
120 | '''
121 | # 创建session对象:
122 | session = DBSession()
123 | # 创建新new_object对象:
124 | new_object = table_name(news_title=news_title, news_url=news_url, news_article=news_article,insert_time=insert_time)
125 | # 添加到session:
126 | session.add(new_object)
127 | # 提交即保存到数据库:
128 | session.commit()
129 | # 关闭session:
130 | session.close()
131 | def insert_wangyinews_classify_into_mysql(table_name, news_id, classify_id):
132 | '''
133 | :param table_name:表名
134 | :param news_id:新闻id
135 | :param classify_id:分类id
136 | :return:
137 | '''
138 | # 创建session对象:
139 | session = DBSession()
140 | # 创建新new_object对象:
141 | new_object = table_name(news_id=news_id, classify_id=classify_id)
142 | # 添加到session:
143 | session.add(new_object)
144 | # 提交即保存到数据库:
145 | session.commit()
146 | # 关闭session:
147 | session.close()
148 | def select_from_mysql(table_name):
149 | '''
150 | 从表中查询,返回一个query对象
151 | :param table_name:
152 | :return:
153 | '''
154 | # 创建session对象:
155 | session = DBSession()
156 | query1 = session.query(table_name)
157 | # article_list = []
158 | # for i in query1.order_by(table_name.news_id.asc()).all():
159 | # article_list.append(i.news_article)
160 | # session.close()
161 | return query1
162 |
163 |
164 |
165 |
166 |
167 |
--------------------------------------------------------------------------------
/text_classification/data/THUCNews/README.md:
--------------------------------------------------------------------------------
1 | **关于数据集**
2 | THUCTC: 一个高效的中文文本分类工具包
3 | 可以去官网下载:(我已经跑完了所有数据集并且已经保存为txt,下载地址见../cnews/readme.md)
4 | http://thuctc.thunlp.org/
--------------------------------------------------------------------------------
/text_classification/data/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/data/__init__.py
--------------------------------------------------------------------------------
/text_classification/data/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/data/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/text_classification/data/__pycache__/cnews_loader.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/data/__pycache__/cnews_loader.cpython-36.pyc
--------------------------------------------------------------------------------
/text_classification/data/cnews/README.md:
--------------------------------------------------------------------------------
1 | **关于数据集**
2 | - 数据集采用清华大学THUCNews全部数据集
3 | - 链接:https://pan.baidu.com/s/1O8yoF15C6qdzRihvHUUNXQ 密码:0nh3
--------------------------------------------------------------------------------
/text_classification/data/cnews_loader.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | import sys
4 | from collections import Counter
5 |
6 | import numpy as np
7 | import tensorflow.contrib.keras as kr
8 |
9 | if sys.version_info[0] > 2:
10 | is_py3 = True
11 | else:
12 | reload(sys)
13 | sys.setdefaultencoding("utf-8")
14 | is_py3 = False
15 |
16 |
17 | def native_word(word, encoding='utf-8'):
18 | """如果在python2下面使用python3训练的模型,可考虑调用此函数转化一下字符编码"""
19 | if not is_py3:
20 | return word.encode(encoding)
21 | else:
22 | return word
23 |
24 |
25 | def native_content(content):
26 | if not is_py3:
27 | return content.decode('utf-8')
28 | else:
29 | return content
30 |
31 |
32 | def open_file(filename, mode='r'):
33 | """
34 | 常用文件操作,可在python2和python3间切换.
35 | mode: 'r' or 'w' for read or write
36 | """
37 | if is_py3:
38 | return open(filename, mode, encoding='utf-8', errors='ignore')
39 | else:
40 | return open(filename, mode)
41 |
42 |
43 | def read_file(filename):
44 | """读取文件数据"""
45 | contents, labels = [], []
46 | with open_file(filename) as f:
47 | for line in f:
48 | try:
49 | label, content = line.strip().split('\t')
50 | if content:
51 | contents.append(list(native_content(content)))
52 | labels.append(native_content(label))
53 | except:
54 | pass
55 | return contents, labels
56 |
57 |
58 | def build_vocab(train_dir, vocab_dir, vocab_size=5000):
59 | """根据训练集构建词汇表,存储"""
60 | data_train, _ = read_file(train_dir)
61 |
62 | all_data = []
63 | for content in data_train:
64 | all_data.extend(content)
65 |
66 | counter = Counter(all_data)
67 | count_pairs = counter.most_common(vocab_size - 1)
68 | words, _ = list(zip(*count_pairs))
69 | # 添加一个 来将所有文本pad为同一长度
70 | words = [''] + list(words)
71 | open_file(vocab_dir, mode='w').write('\n'.join(words) + '\n')
72 |
73 |
74 | def read_vocab(vocab_dir):
75 | """读取词汇表"""
76 | # words = open_file(vocab_dir).read().strip().split('\n')
77 | with open_file(vocab_dir) as fp:
78 | # 如果是py2 则每个值都转化为unicode
79 | words = [native_content(_.strip()) for _ in fp.readlines()]
80 | word_to_id = dict(zip(words, range(len(words))))
81 | return words, word_to_id
82 |
83 |
84 | def read_category():
85 | """读取分类目录,固定"""
86 | categories = ['体育', '财经', '房产', '家居', '教育', '科技', '时尚', '时政', '游戏', '娱乐','股票','彩票','社会','星座']
87 |
88 | categories = [native_content(x) for x in categories]
89 |
90 | cat_to_id = dict(zip(categories, range(len(categories))))
91 |
92 | return categories, cat_to_id
93 |
94 |
95 | def to_words(content, words):
96 | """将id表示的内容转换为文字"""
97 | return ''.join(words[x] for x in content)
98 |
99 |
100 | def process_file(filename, word_to_id, cat_to_id, max_length=600):
101 | """将文件转换为id表示"""
102 | contents, labels = read_file(filename)
103 |
104 | data_id, label_id = [], []
105 | for i in range(len(contents)):
106 | data_id.append([word_to_id[x] for x in contents[i] if x in word_to_id])
107 | label_id.append(cat_to_id[labels[i]])
108 |
109 | # 使用keras提供的pad_sequences来将文本pad为固定长度
110 | x_pad = kr.preprocessing.sequence.pad_sequences(data_id, max_length)
111 | y_pad = kr.utils.to_categorical(label_id, num_classes=len(cat_to_id)) # 将标签转换为one-hot表示
112 |
113 | return x_pad, y_pad
114 |
115 |
116 | def batch_iter(x, y, batch_size=64):
117 | """生成批次数据"""
118 | data_len = len(x)
119 | num_batch = int((data_len - 1) / batch_size) + 1
120 |
121 | indices = np.random.permutation(np.arange(data_len))
122 | x_shuffle = x[indices]
123 | y_shuffle = y[indices]
124 |
125 | for i in range(num_batch):
126 | start_id = i * batch_size
127 | end_id = min((i + 1) * batch_size, data_len)
128 | yield x_shuffle[start_id:end_id], y_shuffle[start_id:end_id]
129 |
--------------------------------------------------------------------------------
/text_classification/helper/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/helper/__init__.py
--------------------------------------------------------------------------------
/text_classification/helper/cnews_group.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | # -*- coding: utf-8 -*-
3 |
4 | """
5 | 将文本整合到 train、test、val 三个文件中
6 | """
7 |
8 | import os
9 | from pathlib import Path #python3自带
10 |
11 | def _read_file(filename):
12 | """读取一个文件并转换为一行"""
13 | with open(filename, 'r', encoding='utf-8') as f:
14 | return f.read().replace('\n', '').replace('\t', '').replace('\u3000', '')
15 |
16 | def save_file(dirname):
17 | """
18 | 将多个文件整合并存到3个文件中
19 | dirname: 原数据目录
20 | 文件内容格式: 类别\t内容
21 | """
22 | f_train = open('data/cnews/cnews.train.txt', 'w', encoding='utf-8')
23 | f_test = open('data/cnews/cnews.test.txt', 'w', encoding='utf-8')
24 | f_val = open('data/cnews/cnews.val.txt', 'w', encoding='utf-8')
25 | for category in os.listdir(dirname): # 分类目录
26 | cat_dir = os.path.join(dirname, category)
27 | if not os.path.isdir(cat_dir):
28 | continue
29 | files = os.listdir(cat_dir)
30 | count = 0
31 | data_num = len(list(Path(cat_dir).iterdir())) #读取当前目录下的文件总数
32 | for cur_file in files:
33 | filename = os.path.join(cat_dir, cur_file)
34 | content = _read_file(filename)
35 | if count < int(data_num*0.7):
36 | f_train.write(category + '\t' + content + '\n')
37 | elif count < int(data_num*0.85):
38 | f_test.write(category + '\t' + content + '\n')
39 | else:
40 | f_val.write(category + '\t' + content + '\n')
41 | count += 1
42 |
43 | print('Finished:', category)
44 |
45 | f_train.close()
46 | f_test.close()
47 | f_val.close()
48 |
49 |
50 | if __name__ == '__main__':
51 | save_file('data/thucnews')
52 | print(len(open('data/cnews/cnews.train.txt', 'r', encoding='utf-8').readlines()))
53 | print(len(open('data/cnews/cnews.test.txt', 'r', encoding='utf-8').readlines()))
54 | print(len(open('data/cnews/cnews.val.txt', 'r', encoding='utf-8').readlines()))
55 |
--------------------------------------------------------------------------------
/text_classification/images/cnn_architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/images/cnn_architecture.png
--------------------------------------------------------------------------------
/text_classification/images/news_classify.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/images/news_classify.png
--------------------------------------------------------------------------------
/text_classification/images/text_analysis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/images/text_analysis.png
--------------------------------------------------------------------------------
/text_classification/predict_mysql.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # encoding: utf-8
4 |
5 | '''
6 |
7 | @author: Zhao Chi
8 |
9 | @contact: Vectors@aliyun.com
10 |
11 | @software: PyCharm
12 |
13 | @file: predict_mysql.py
14 |
15 | @time: 2018/4/10 9:45
16 |
17 | @desc:
18 |
19 | '''
20 |
21 |
22 | from __future__ import print_function
23 |
24 | import os
25 | import tensorflow as tf
26 | import tensorflow.contrib.keras as kr
27 | from cnn_model import TCNNConfig, TextCNN
28 | from data.cnews_loader import read_category, read_vocab
29 | import time as time1
30 | from connect_mysql import *
31 | from wangyinews_crawler import *
32 | try:
33 | bool(type(unicode))
34 | except NameError:
35 | unicode = str
36 |
37 | base_dir = 'data/cnews'
38 | vocab_dir = os.path.join(base_dir, 'cnews.vocab.txt')
39 |
40 | save_dir = 'checkpoints/textcnn'
41 | save_path = os.path.join(save_dir, 'best_validation') # 最佳验证结果保存路径
42 |
43 |
44 | class CnnModel:
45 | def __init__(self):
46 | self.config = TCNNConfig()
47 | self.categories, self.cat_to_id = read_category()
48 | self.words, self.word_to_id = read_vocab(vocab_dir)
49 | self.config.vocab_size = len(self.words)
50 | self.model = TextCNN(self.config)
51 |
52 | self.session = tf.Session()
53 | self.session.run(tf.global_variables_initializer())
54 | saver = tf.train.Saver()
55 | saver.restore(sess=self.session, save_path=save_path) # 读取保存的模型
56 |
57 | def predict(self, message):
58 | # 支持不论在python2还是python3下训练的模型都可以在2或者3的环境下运行
59 | content = unicode(message)
60 | data = [self.word_to_id[x] for x in content if x in self.word_to_id]
61 |
62 | feed_dict = {
63 | self.model.input_x: kr.preprocessing.sequence.pad_sequences([data], self.config.seq_length),
64 | self.model.keep_prob: 1.0
65 | }
66 |
67 | y_pred_cls = self.session.run(self.model.y_pred_cls, feed_dict=feed_dict)
68 | return self.categories[y_pred_cls[0]]
69 |
70 |
71 | if __name__ == '__main__':
72 | cnn_model = CnnModel()
73 | # 程序整点执行
74 | time1.sleep((int(time1.time() / 3600) + 1) * 3600 - time1.time())
75 | while True:
76 |
77 | # 获取程序执行时间
78 | start_time = time1.time()
79 | time = wangyinews_crawler() # 爬虫爬取时间
80 | # 获取当前时间格式为2018041018
81 | query1 = select_from_mysql(wangyi_news) # 从wangyi_news中读取对象
82 | # time和爬虫插入的时间同步 暂未定义
83 | for i in query1.order_by(wangyi_news.news_id.asc()).filter(wangyi_news.insert_time==time):
84 | insert_wangyinews_classify_into_mysql(wangyi_news_classify, i.news_id, classify_dict[cnn_model.predict(i.news_article)])
85 | query2 = select_from_mysql(view_news_classify) # 从视图中读取对象
86 | # 打印分析的内容 部署完成之后注释
87 | # for i in query2.filter(view_news_classify.insert_time==time):
88 | # print(i.news_title, '\t', i.classify, '\t', i.insert_time, '\t', i.news_url)
89 | print(time, "Finished!")
90 | # 获取程序结束时间
91 | end_time = time1.time()
92 | # 每小时爬取一次
93 | time1.sleep(3600-(end_time-start_time))
94 |
--------------------------------------------------------------------------------
/text_classification/server_predict.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # encoding: utf-8
4 |
5 | '''
6 |
7 | @author: Zhao Chi
8 |
9 | @contact: Vectors@aliyun.com
10 |
11 | @software: PyCharm
12 |
13 | @file: predit_mysql.py
14 |
15 | @time: 2018/4/10 9:45
16 |
17 | @desc:
18 |
19 | '''
20 |
21 |
22 | from __future__ import print_function
23 | import os
24 | import tensorflow as tf
25 | import tensorflow.contrib.keras as kr
26 | from cnn_model import TCNNConfig, TextCNN
27 | from data.cnews_loader import read_category, read_vocab
28 | from connect_mysql import *
29 | from wangyinews_crawler import *
30 | from socket import *
31 | import threading
32 | import time
33 | try:
34 | bool(type(unicode))
35 | except NameError:
36 | unicode = str
37 |
38 |
39 | # 配置训练好的模型信息
40 | base_dir = 'data/cnews'
41 | vocab_dir = os.path.join(base_dir, 'cnews.vocab.txt')
42 |
43 | save_dir = 'checkpoints/textcnn'
44 | save_path = os.path.join(save_dir, 'best_validation') # 最佳验证结果保存路径
45 |
46 | # 配置服务器信息
47 | address='127.0.0.1' #监听哪些网络 127.0.0.1是监听本机 0.0.0.0是监听整个网络
48 | port=12345 #监听自己的哪个端口
49 | buffsize=8192 #接收从客户端发来的数据的缓存区大小
50 | s = socket(AF_INET, SOCK_STREAM)
51 | s.bind((address,port))
52 | s.listen(5) # 最大连接数
53 |
54 | def tcplink(sock,addr):
55 | '''
56 | 创建tcp链接
57 | :param sock:
58 | :param addr:
59 | :return:
60 | '''
61 | print('Accept new connection from %s:%s...' % addr)
62 | #sock.send(b'Welcome!')
63 | while True:
64 | recvdata = sock.recv(buffsize)
65 | classified = cnn_model.predict(recvdata.decode('utf-8'))
66 |
67 | time.sleep(1)
68 | if recvdata.decode('utf-8')=='exit' or not recvdata:
69 | break
70 | sock.send(classified.encode('utf-8'))
71 | sock.close()
72 | print('Connection from %s:%s closed.' % addr)
73 |
74 |
75 | class CnnModel:
76 | def __init__(self):
77 | self.config = TCNNConfig()
78 | self.categories, self.cat_to_id = read_category()
79 | self.words, self.word_to_id = read_vocab(vocab_dir)
80 | self.config.vocab_size = len(self.words)
81 | self.model = TextCNN(self.config)
82 |
83 | self.session = tf.Session()
84 | self.session.run(tf.global_variables_initializer())
85 | saver = tf.train.Saver()
86 | saver.restore(sess=self.session, save_path=save_path) # 读取保存的模型
87 |
88 | def predict(self, message):
89 | # 支持不论在python2还是python3下训练的模型都可以在2或者3的环境下运行
90 | content = unicode(message)
91 | data = [self.word_to_id[x] for x in content if x in self.word_to_id]
92 |
93 | feed_dict = {
94 | self.model.input_x: kr.preprocessing.sequence.pad_sequences([data], self.config.seq_length),
95 | self.model.keep_prob: 1.0
96 | }
97 |
98 | y_pred_cls = self.session.run(self.model.y_pred_cls, feed_dict=feed_dict)
99 | return self.categories[y_pred_cls[0]]
100 |
101 |
102 | if __name__ == '__main__':
103 | cnn_model = CnnModel()
104 | while True:
105 | sock, addr = s.accept()
106 | print('connect from:', addr)
107 | t = threading.Thread(target=tcplink, args=(sock, addr)) # t为新创建的线程
108 | t.start()
109 |
110 |
--------------------------------------------------------------------------------
/text_classification/startproject.sh:
--------------------------------------------------------------------------------
1 | nohup python -u /home/www/text_classification/text_classification/predict_mysql.py > /home/www/text_classification/log/predict_mysql.log 2>&1 &
2 | nohup python -u /home/www/text_classification/text_classification/server_predict.py > /home/www/text_classification/log/server_predict.log 2>&1 &
3 | nohup python -u /home/www/text_classification/manage.py runserver 0.0.0.0:80 > /home/www/text_classification/log/websit.log 2>&1 &
4 |
--------------------------------------------------------------------------------
/text_classification/tensorboard/textcnn/events.out.tfevents.1523023586.dandan:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/text_classification/tensorboard/textcnn/events.out.tfevents.1523023586.dandan
--------------------------------------------------------------------------------
/text_classification/wangyinews_crawler.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # encoding: utf-8
4 |
5 | '''
6 |
7 | @author: Zhao Chi
8 |
9 | @contact: Vectors@aliyun.com
10 |
11 | @software: PyCharm
12 |
13 | @file: wangyinews_crawler.py
14 |
15 | @time: 2018/4/10 11:19
16 |
17 | @desc:
18 |
19 | '''
20 | from bs4 import BeautifulSoup
21 | import requests
22 | import re
23 | import datetime
24 | from connect_mysql import *
25 |
26 |
27 | def wangyinews_crawler():
28 | # 获取当前时间格式为2018041018
29 | time = datetime.datetime.now().strftime("%Y%m%d%H")
30 | url = r'http://news.163.com/special/0001386F/rank_news.html'
31 | # 模拟真实浏览器进行访问
32 | headers = {'User-Agent':
33 | 'Mozilla/5.0 (Windows NT 10.0; WOW64) '
34 | 'AppleWebKit/537.36 (KHTML, like Gecko) '
35 | 'Chrome/55.0.2883.87 Safari/537.36'}
36 | response = requests.get(url, headers=headers)
37 | page_html = response.text
38 |
39 | # 将获取到的内容转换成BeautifulSoup格式,并将html.parser作为解析器
40 | soup = BeautifulSoup(page_html, 'html.parser')
41 |
42 | #获取一小时前点击率最高的前20个新闻标题和链接
43 | titles = soup.find('div', 'area-half left').find('div', 'tabContents active').find_all('a', limit=20)
44 | for title in titles:
45 | # 打印爬取到的title和url
46 | #print(str(title.string))
47 | #print(title.get('href'))
48 |
49 | '''
50 | news_url:新闻链接
51 | news_html:新闻页网页源代码
52 | '''
53 | news_url = (str(title.get('href')))
54 | news_response = requests.get(news_url, headers=headers)
55 | news_html = news_response.text
56 | # 将获取到的内容转换成BeautifulSoup格式,并将html.parser作为解析器
57 | news_soup = BeautifulSoup(news_html, 'html.parser')
58 | # 从网页源代码中找到属于post_text类的div,并将所有p标签内容存入列表news_contents
59 | if news_soup.find('div', 'post_text') is None: # 如果网页丢失,跳出本次循环
60 | continue
61 | news_title = news_soup.find('h1')
62 | contents = news_soup.find('div', 'post_text').find_all('p')
63 | news_contents = []
64 | for content in contents:
65 | if content.string is not None:
66 | #去掉特殊字符
67 | news_contents.append(re.sub('[\r\n\t ]', '', str(content.string)))
68 | #字符串拼接
69 | news_contents = ''.join(news_contents)
70 | # print(news_contents)
71 | # print(type(news_contents))
72 | # 将爬取到的数据存入数据库
73 | insert_wangyinews_into_mysql(wangyi_news, str(news_title.string), news_url, news_contents, time)
74 | # print('Finished')
75 | # 返回当前爬取时间
76 | return time
--------------------------------------------------------------------------------
/web/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/__init__.py
--------------------------------------------------------------------------------
/web/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/web/__pycache__/admin.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/__pycache__/admin.cpython-36.pyc
--------------------------------------------------------------------------------
/web/__pycache__/apps.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/__pycache__/apps.cpython-36.pyc
--------------------------------------------------------------------------------
/web/__pycache__/client.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/__pycache__/client.cpython-36.pyc
--------------------------------------------------------------------------------
/web/__pycache__/connect_mysql.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/__pycache__/connect_mysql.cpython-36.pyc
--------------------------------------------------------------------------------
/web/__pycache__/models.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/__pycache__/models.cpython-36.pyc
--------------------------------------------------------------------------------
/web/__pycache__/selectFromDb.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/__pycache__/selectFromDb.cpython-36.pyc
--------------------------------------------------------------------------------
/web/__pycache__/views.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/__pycache__/views.cpython-36.pyc
--------------------------------------------------------------------------------
/web/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
4 |
--------------------------------------------------------------------------------
/web/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class WebConfig(AppConfig):
5 | name = 'web'
6 |
--------------------------------------------------------------------------------
/web/client.py:
--------------------------------------------------------------------------------
1 | from socket import *
2 | def sen_info(info):
3 | address='127.0.0.1' #服务器的ip地址
4 | port=12345 #服务器的端口号
5 | buffsize=4096 #接收数据的缓存大小
6 | s = socket(AF_INET, SOCK_STREAM)
7 | s.connect((address,port))
8 | s.send(info.encode())
9 | recvdata=s.recv(buffsize).decode('utf-8')
10 | s.close()
11 | return recvdata
12 |
--------------------------------------------------------------------------------
/web/connect_mysql.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # encoding: utf-8
4 |
5 | '''
6 |
7 | @author: Zhao Chi
8 |
9 | @contact: Vectors@aliyun.com
10 |
11 | @software: PyCharm
12 |
13 | @file: connect_mysql.py
14 |
15 | @time: 2018/4/10 0:13
16 |
17 | @desc:
18 |
19 | '''
20 | # 导入:
21 | from sqlalchemy import Column, create_engine, ForeignKey
22 | from sqlalchemy.types import String,Integer,VARCHAR,TEXT
23 | from sqlalchemy.orm import sessionmaker
24 | from sqlalchemy.ext.declarative import declarative_base
25 | # 创建对象的基类:
26 | Base = declarative_base()
27 |
28 |
29 | # 定义表对象:
30 | class wangyi_news(Base):
31 | '''
32 | wangyi_news:存放爬虫爬取的数据
33 | '''
34 | # 表的名字:
35 | __tablename__ = 'wangyi_news'
36 | # 表的结构:
37 | news_id = Column(Integer, primary_key=True)
38 | news_title = Column(VARCHAR(600))
39 | news_url = Column(VARCHAR(600))
40 | news_article = Column(TEXT)
41 | insert_time = Column(VARCHAR(11))
42 |
43 |
44 | class news_classify(Base):
45 | '''
46 | news_classify:存放新闻的种类以及新闻id,固定的,不更新
47 | '''
48 | # 表的名字
49 | __tablename__ = 'news_classify'
50 | # 表的结构
51 | classify_id = Column(Integer, primary_key=True)
52 | classify = Column(VARCHAR(10))
53 |
54 |
55 | class wangyi_news_classify(Base):
56 | '''
57 | wangyi_news_classify:存放经过程序分类后的结果
58 | '''
59 | __tablename__ = 'wangyi_news_classify'
60 | id = Column(Integer, primary_key=True)
61 | news_id = Column(Integer, ForeignKey(wangyi_news.news_id)) # 外键
62 | classify_id = Column(Integer, ForeignKey(news_classify.classify_id)) # 外键
63 |
64 |
65 | # 定义视图
66 | class view_news_classify(Base):
67 | '''
68 | view_news_classify:通过以下sql语句
69 | select wangyi_news_classify.news_id,news_title,news_url,insert_time,classify
70 | from wangyi_news,news_classify,wangyi_news_classify
71 | where wangyi_news.news_id = wangyi_news_classify.news_id
72 | and news_classify.classify_id = wangyi_news_classify.classify_id
73 | order by wangyi_news_classify.news_id asc
74 | 创建的视图
75 | '''
76 | # 视图名字
77 | __tablename__ = 'view_news_classify'
78 | # 视图结构
79 | news_id = Column(Integer, primary_key=True)
80 | news_title = Column(VARCHAR(600))
81 | insert_time = Column(VARCHAR(11))
82 | classify = Column(VARCHAR(10))
83 | news_url = Column(VARCHAR(600))
84 |
85 |
86 |
87 | # 定义字典 加快读取速度
88 | classify_dict = {
89 |
90 | '体育': 1,
91 | '财经': 2,
92 | '房产': 3,
93 | '家居': 4,
94 | '教育': 5,
95 | '科技': 6,
96 | '时尚': 7,
97 | '时政': 8,
98 | '游戏': 9,
99 | '娱乐': 10,
100 | '股票': 11,
101 | '彩票': 12,
102 | '社会': 13,
103 | '星座': 14
104 | }
105 |
106 | engine = create_engine('mysql+mysqlconnector://root:159357@127.0.0.1:3306/text_classification')
107 | # 创建DBSession类型:
108 | DBSession = sessionmaker(bind=engine)
109 |
110 | def insert_wangyinews_into_mysql(table_name, news_title, news_url, news_article, insert_time):
111 | '''
112 |
113 | :param table_name:表名
114 | :param news_title:新闻标题
115 | :param news_url:新闻地址
116 | :param news_article:新闻文章内容
117 | :param insert_time:将新闻插入数据库的时间
118 | :return:
119 | '''
120 | # 创建session对象:
121 | session = DBSession()
122 | # 创建新new_object对象:
123 | new_object = table_name(news_title=news_title, news_url=news_url, news_article=news_article,insert_time=insert_time)
124 | # 添加到session:
125 | session.add(new_object)
126 | # 提交即保存到数据库:
127 | session.commit()
128 | # 关闭session:
129 | session.close()
130 | def insert_wangyinews_classify_into_mysql(table_name, news_id, classify_id):
131 | '''
132 | :param table_name:表名
133 | :param news_id:新闻id
134 | :param classify_id:分类id
135 | :return:
136 | '''
137 | # 创建session对象:
138 | session = DBSession()
139 | # 创建新new_object对象:
140 | new_object = table_name(news_id=news_id, classify_id=classify_id)
141 | # 添加到session:
142 | session.add(new_object)
143 | # 提交即保存到数据库:
144 | session.commit()
145 | # 关闭session:
146 | session.close()
147 | def select_from_mysql(table_name):
148 | '''
149 | 从表中查询,返回一个query对象
150 | :param table_name:
151 | :return:
152 | '''
153 | # 创建session对象:
154 | session = DBSession()
155 | query1 = session.query(table_name)
156 | # article_list = []
157 | # for i in query1.order_by(table_name.news_id.asc()).all():
158 | # article_list.append(i.news_article)
159 | # session.close()
160 | return query1
161 |
162 |
163 |
164 |
165 |
166 |
--------------------------------------------------------------------------------
/web/hotNews.css:
--------------------------------------------------------------------------------
1 | @font-face
2 | {
3 | font-family: spFont;
4 | src: url(../font/fz.TTF);
5 | }
6 | .main .info_list li{
7 | list-style: none;
8 | width: 100%;
9 | }
10 | .page{
11 | float: left;
12 | width: 15px;
13 | margin-left: 5px;
14 |
15 | }
16 | .page a{
17 | text-decoration: none;
18 | }
19 |
20 | .main_window_top{
21 | padding-top: 35px;
22 | width: 90%;
23 | margin: 0 auto;
24 | font-family: spFont;
25 | }
26 | .news_title{
27 | margin-left: 0%;
28 | font-size: 25px;
29 | color: red;
30 | }
31 | .classify{
32 | margin-left: 41%;
33 | font-size: 25px;
34 | color: blue;
35 | }
36 | .info_classify {
37 | /*float: right;*/
38 | margin-left: 9%;
39 | }
40 | .line{
41 | width: 100%;
42 | background-repeat: no-repeat;
43 | background-size: 100% 100%;
44 | clip: rect(0, 0 ,50px, 50px);
45 | }
46 |
47 | .info_list{
48 | margin-top: 50px;
49 | width: 1356px;
50 | }
51 | .info_item{
52 | margin: 0 auto;
53 | }
54 | .info_list li{
55 | margin-top: 40px;
56 | font-size: 18px;
57 | width: 1608px;
58 | font-family: spFont;
59 | }
60 |
61 | .info_list li a{
62 | margin-left: 40px;
63 | display:inline-block;
64 | width:500px;
65 | }
66 |
67 | .main{
68 | margin-top: 80px;
69 | margin-left: 5%;
70 | height: 640px;
71 | width: 91%;
72 |
73 | }
74 |
75 | .pagination{
76 | padding: 0px;
77 | list-style: none;
78 | width: 270px;
79 | height: 30px;
80 | margin:0 auto;
81 | }
82 |
83 | .pagination li a{
84 | font-size: 18px;
85 | }
86 | /*.info_block {*/
87 | /*text-align: center;*/
88 | /*width: 600px;*/
89 | /*margin: 45px auto;*/
90 | /*}*/
91 |
92 |
93 | .pageone{
94 | width: 25px;
95 | height: 30px;
96 | margin: 25px auto;
97 | }
98 |
99 | .time{
100 | margin-left: 36%;
101 | font-size: 25px;
102 | color: blue;
103 | }
104 | .info_time{
105 | margin-left: 31%;
106 | }
107 |
108 | .info_body{
109 | width: 1500px;
110 | margin: 0 auto;
111 | }
112 |
113 | .info_info{
114 | width: 1400px;
115 |
116 |
117 | margin: 0 auto ;
118 | }
--------------------------------------------------------------------------------
/web/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/migrations/__init__.py
--------------------------------------------------------------------------------
/web/migrations/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/migrations/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/web/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 |
--------------------------------------------------------------------------------
/web/selectFromDb.py:
--------------------------------------------------------------------------------
1 | #__author__:Omen
2 | #date:2018/4/12
3 | from web.connect_mysql import *
4 | import datetime
5 | def change(time):
6 | year = time[0:4]
7 | mounth = time[4:6]
8 | day = time[6:8]
9 | hour = time[8:]
10 | return(year+'.'+mounth+'.' +day+ ' '+' '+hour+' : 00')
11 | def select():
12 | time = datetime.datetime.now().strftime("%Y%m%d%H") # 获取当前时间。
13 | query1 = select_from_mysql(view_news_classify) # 查询视图,时间符合当前时间。
14 |
15 | info_list = [] # 空的list 用于存储数据。
16 |
17 | for i in query1.filter(view_news_classify.insert_time==time):
18 | insert_time = change(i.insert_time)
19 | dict = {'id': i.news_id, # 新建字典用于存储一条数据。
20 | 'title': i.news_title,
21 | 'time': insert_time,
22 | 'classify': i.classify,
23 | 'url': i.news_url,
24 | }
25 |
26 | info_list.append(dict)
27 |
28 |
29 | return info_list # 返回list。
30 |
--------------------------------------------------------------------------------
/web/static/css/aboutUS.css:
--------------------------------------------------------------------------------
1 | @font-face
2 | {
3 | font-family: spFont;
4 | src: url(../font/fz.TTF);
5 | }
6 | .main{
7 | /*box-shadow: 5px 5px 2px 0px rgba(29,42,114,0.15);*/
8 | background-size: 100% 100%;
9 | background-repeat: no-repeat;
10 | }
11 |
12 | .main_title{
13 | width: 74px;
14 | height: 57px;
15 | /* margin-top: 94px; */
16 | padding-top: 14px;
17 | margin: auto;
18 | text-align: center;
19 | }
20 | .team{
21 | font-family: spFont;
22 | width: 850px;
23 | margin: 50px auto;
24 | color: #282c80;
25 | font-weight: bold;
26 | line-height: 28px;
27 |
28 | }
29 | .project{
30 | width: 900px;
31 | margin: 97px auto;
32 |
33 |
34 | }
35 |
36 | .project p{
37 | line-height: 28px;
38 | font-family: spFont;
39 | font-weight: bold;
40 | color: #282c80;
41 | margin-left: 24%;
42 |
43 | }
--------------------------------------------------------------------------------
/web/static/css/articleAnalyze.css:
--------------------------------------------------------------------------------
1 |
2 | .main{
3 | background-size: 100% 100%;
4 | background-repeat: no-repeat;
5 | }
6 | @font-face
7 | {
8 | font-family: spFont;
9 | src: url(../font/fz.TTF);
10 | }
11 |
12 | .textarea{
13 | padding-top: 50px;
14 | }
15 | textarea{
16 | height: 310px;
17 | width:86%;
18 | margin-left: 7%;
19 | resize: none;
20 | outline: none;
21 | border: none;
22 | }
23 |
24 | .button{
25 | height: 31px;
26 | width: 112px;
27 | border: none;
28 | margin-top: 70px;
29 | margin-left: 87px;
30 | }
31 |
32 | .tag{
33 | margin-top: 235px;
34 | margin-left: 135px;
35 | }
36 | .tag ul li{
37 | list-style: none;
38 | float: left;
39 | font-size: 30px;
40 | margin-left: 25px;
41 | font-family: spFont;
42 | color: #282c80;
43 | font-weight: bold;
44 | }
45 | .chooser{
46 | list-style:none;
47 | width: 900px;
48 | margin: -107px auto;
49 | }
50 | .chooser_li{
51 | margin-left: 50px;
52 | }
53 | .chooser_ul{
54 | list-style: none;
55 | }
--------------------------------------------------------------------------------
/web/static/css/hotNews.css:
--------------------------------------------------------------------------------
1 | @font-face
2 | {
3 | font-family: spFont;
4 | src: url(../font/fz.TTF);
5 | }
6 | .main .info_list li{
7 | list-style: none;
8 | width: 100%;
9 | }
10 | .page{
11 | float: left;
12 | width: 15px;
13 | margin-left: 5px;
14 |
15 | }
16 | .page a{
17 | text-decoration: none;
18 | }
19 |
20 | .main_window_top{
21 | padding-top: 35px;
22 | width: 90%;
23 | margin: 0 auto;
24 | font-family: spFont;
25 | }
26 | .news_title{
27 | margin-left: 10.5px;
28 | font-size: 25px;
29 | color: red;
30 | }
31 | .classify{
32 | margin-left: 40.5%;
33 | font-size: 25px;
34 | color: blue;
35 | }
36 | .info_classify {
37 | /*float: right;*/
38 | margin-left: 9%;
39 | }
40 | .line{
41 | width: 100%;
42 | background-repeat: no-repeat;
43 | background-size: 100% 100%;
44 | clip: rect(0, 0 ,50px, 50px);
45 | }
46 |
47 | .info_list{
48 | margin-top: 50px;
49 | width: 1356px;
50 | }
51 | .info_item{
52 | margin: 0 auto;
53 | }
54 | .info_list li{
55 | margin-top: 40px;
56 | font-size: 18px;
57 | width: 1608px;
58 | font-family: spFont;
59 | }
60 |
61 | .info_list li a{
62 | margin-left: 40px;
63 | display:inline-block;
64 | width:500px;
65 | }
66 |
67 | .main{
68 | margin-top: 80px;
69 | margin-left: 5%;
70 | height: 640px;
71 | width: 91%;
72 |
73 | }
74 |
75 | .pagination{
76 | padding: 0px;
77 | list-style: none;
78 | width: 270px;
79 | height: 30px;
80 | margin:0 auto;
81 | }
82 |
83 | .pagination li a{
84 | font-size: 18px;
85 | }
86 | /*.info_block {*/
87 | /*text-align: center;*/
88 | /*width: 600px;*/
89 | /*margin: 45px auto;*/
90 | /*}*/
91 |
92 |
93 | .pageone{
94 | width: 25px;
95 | height: 30px;
96 | margin: 25px auto;
97 | }
98 |
99 | .time{
100 | margin-left: 32.5%;
101 | font-size: 25px;
102 | color: blue;
103 | }
104 | .info_time{
105 | margin-left: 31%;
106 | }
107 |
108 | .info_body{
109 | width: 1500px;
110 | margin: 0 auto;
111 | }
112 |
113 | .info_info{
114 | width: 1400px;
115 |
116 |
117 | margin: 0 auto ;
118 | }
--------------------------------------------------------------------------------
/web/static/css/main.css:
--------------------------------------------------------------------------------
1 | body{
2 | margin-top: 0px;
3 | background-color: #ebebeb;
4 | margin: auto;
5 | width: 100%;
6 | max-width: 1920px;
7 | min-width: 1600px;
8 | }
9 |
10 | .banner{
11 | margin: auto;
12 | height: 640px;
13 | width: 100%;
14 | background-repeat: no-repeat;
15 | background-position:center top;
16 | }
17 |
18 | .logo{
19 | font-size: 24px;
20 | color: white;
21 | font-family: Gadugi;
22 | margin-left: 2.604%;
23 | padding-top: 5px;
24 | }
25 | .address{
26 | margin-top: -25px;
27 | margin-left: 92.7%;
28 | font-size: 16px;
29 | color: white;
30 | font-family: Gadugi;
31 | }
32 |
33 | .Category{
34 | margin-top: 25px;
35 | margin-left: 2.604%;
36 | height: 24px;
37 | width: 26px;
38 | background-size: 24px 26px;
39 | }
40 | .nav{
41 | float: left;
42 | margin-top: -39px;
43 | }
44 | .nav ul li{
45 | font-family: 微软雅黑;
46 | list-style: none;
47 | float: left;
48 | color: white;
49 | font-size: 22px;
50 | margin-left: 70px;
51 | }
52 |
53 | .nav ul li a{
54 | color: white;
55 | text-decoration: none;
56 | }
57 | .nav ul li a:hover {
58 | color: #c8c8c8;
59 | }
60 |
61 | .navigationBar2{
62 | margin-top: 453px;
63 | width: 1000px;
64 | height: 200px;
65 | margin: 453px auto;
66 | }
67 |
68 | .nav2_1{
69 | float: left;
70 | margin-left: 65px;
71 | }
72 | .nav2_2{
73 | float: left;
74 | margin-left: 132px;
75 | }
76 |
77 | .nav2_3{
78 | float: left;
79 | margin-left: 117px;
80 | }
81 | .nav_2_1_1{
82 | font-size: 24px;
83 | color: #fff;
84 | font-family: 微软雅黑;
85 | }
86 | .nav_2_1_2{
87 | margin-top: -17px;
88 | font-size: 16px;
89 | color: #fff;
90 | font-family: 黑体;
91 | }
92 | .main{
93 | margin: 80px auto;
94 | height: 640px;
95 | width: 91%;
96 | background-color: white;
97 | box-shadow: 5px 5px 2px 0px rgba(29,42,114,0.15);
98 | }
99 | .foot{
100 | margin-top: 80px;
101 | height: 150px;
102 | /*border:1px solid red;*/
103 | width: 800px;
104 | margin: auto;
105 | }
106 |
107 |
108 |
109 | .foot p{
110 | text-align: center;
111 | }
112 |
113 | .foot_1{
114 | margin-top: 50px;
115 | text-align: center;
116 |
117 | }
118 |
119 | .foot_1 a{
120 | text-decoration: none;
121 | }
--------------------------------------------------------------------------------
/web/static/css/main_back.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/static/css/main_back.css
--------------------------------------------------------------------------------
/web/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/static/favicon.ico
--------------------------------------------------------------------------------
/web/static/font/fz.TTF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/static/font/fz.TTF
--------------------------------------------------------------------------------
/web/static/imgs/Category.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/static/imgs/Category.png
--------------------------------------------------------------------------------
/web/static/imgs/aboutUS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/static/imgs/aboutUS.png
--------------------------------------------------------------------------------
/web/static/imgs/banner_about_us.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/static/imgs/banner_about_us.png
--------------------------------------------------------------------------------
/web/static/imgs/banner_atricle_analyzie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/static/imgs/banner_atricle_analyzie.png
--------------------------------------------------------------------------------
/web/static/imgs/banner_hot_news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/static/imgs/banner_hot_news.png
--------------------------------------------------------------------------------
/web/static/imgs/button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/static/imgs/button.png
--------------------------------------------------------------------------------
/web/static/imgs/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/static/imgs/line.png
--------------------------------------------------------------------------------
/web/static/imgs/wenzi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vectorsss/news_classification/02fd30eeff5f71d3789d6f38e55b4d9e2ddb601f/web/static/imgs/wenzi.png
--------------------------------------------------------------------------------
/web/static/js/aboutUS.js:
--------------------------------------------------------------------------------
1 | //none
--------------------------------------------------------------------------------
/web/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/web/views.py:
--------------------------------------------------------------------------------
1 | from django.shortcuts import render, resolve_url, redirect, render_to_response, reverse
2 |
3 | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
4 | from web.selectFromDb import *
5 | from web.client import *
6 |
7 | # Create your views here.
8 |
9 | classify_list = [] # 用于存储分类
10 | get_art = ''''''
11 | article = '''
12 | 魔兽世界:争霸艾泽拉斯重回起点,大结局或提前出现?伏笔太多!
13 |
14 | 魔兽世界陪伴了勇士们已经10年了,在这10年里很多我们称之为“神”的BOSS,都已经被脚男们推到。而魔兽世界的主线历史背景似乎也穷途末路,随着游戏策划们创意的枯竭,暴雪迫切需要一个版本来填坑过度,所以8.0争霸艾泽拉斯应运而生。
15 |
16 | 魔兽世界:争霸艾泽拉斯重回起点,大结局或提前出现?伏笔太多!
17 |
18 |
19 | 争霸艾泽拉斯
20 |
21 | 在我们击败黑暗泰坦萨格拉斯的时候,勇士们发现有一个更大的阴谋笼罩着整个宇宙。似乎萨格拉斯的燃烧军团并不是只是为了单纯的杀戮,从这个大版本最后的结局中,我们发现隐藏再虚空背后有一个连泰坦众神都害怕的敌人——虚空!
22 |
23 | 看完魔兽这样的故事走向,我越来越觉得这个以魔幻为题材的游戏,却有点像星际争霸的剧情了。邪恶的虫群最后也被洗白,最后三族联盟共同面对宇宙中最强的BOSS“艾蒙”。
24 |
25 | 难道最后我们艾泽拉斯也会联手泰坦众神,还有燃烧军团一起抵抗最大的敌人虚空吗?
26 |
27 | 魔兽世界:争霸艾泽拉斯重回起点,大结局或提前出现?伏笔太多!
28 |
29 | 萨格拉斯
30 |
31 | 争霸艾泽拉斯这个版本,虽然表面上是联盟与部落阵营的一场大冲突,可是在这冲突之下也隐藏着巨大的伏笔!而萨格拉斯最后怒劈艾泽拉斯星球的那把神剑,最后也一定能成为一个重要的“引子”。
32 |
33 | 而两个阵营的冲突更是让我们有很多想不通的疑点,比如希尔瓦娜斯为何火烧泰达希尔?在共同抵御了燃烧军团以后,希女王肯定不会无缘无故的去做贸然撕毁盟约的事情。
34 |
35 | 而最有可能的情况就是,泰达希尔的根部已经被上古之神腐化了,而上古之神就是虚空的爪牙!
36 |
37 | 魔兽世界:争霸艾泽拉斯重回起点,大结局或提前出现?伏笔太多!
38 |
39 | 火烧泰达希尔
40 |
41 | 最后让我们想想魔兽争霸WAR3的开场动画,当联盟和部落在大战一触即发的时候,天空突然被邪能笼罩,漫天开始落下火雨和恶魔......而这样的场景,是否会在“争霸艾泽拉斯”版本的最后出现呢?
42 |
43 | 虚空突然被撕裂,上古之神拔地而起,众神齐聚艾泽拉斯,而艾泽拉斯的星魂成为了最强的泰坦参与战斗,这也许就是魔兽世界的大结局吧! 7月15日
44 | '''
45 |
46 | source = '''
47 | 魔兽世界:争霸艾泽拉斯重回起点,大结局或提前出现?伏笔太多!
48 |
49 | 魔兽世界陪伴了勇士们已经10年了,在这10年里很多我们称之为“神”的BOSS,都已经被脚男们推到。而魔兽世界的主线历史背景似乎也穷途末路,随着游戏策划们创意的枯竭,暴雪迫切需要一个版本来填坑过度,所以8.0争霸艾泽拉斯应运而生。
50 |
51 | 魔兽世界:争霸艾泽拉斯重回起点,大结局或提前出现?伏笔太多!
52 |
53 |
54 | 争霸艾泽拉斯
55 |
56 | 在我们击败黑暗泰坦萨格拉斯的时候,勇士们发现有一个更大的阴谋笼罩着整个宇宙。似乎萨格拉斯的燃烧军团并不是只是为了单纯的杀戮,从这个大版本最后的结局中,我们发现隐藏再虚空背后有一个连泰坦众神都害怕的敌人——虚空!
57 |
58 | 看完魔兽这样的故事走向,我越来越觉得这个以魔幻为题材的游戏,却有点像星际争霸的剧情了。邪恶的虫群最后也被洗白,最后三族联盟共同面对宇宙中最强的BOSS“艾蒙”。
59 |
60 | 难道最后我们艾泽拉斯也会联手泰坦众神,还有燃烧军团一起抵抗最大的敌人虚空吗?
61 |
62 | 魔兽世界:争霸艾泽拉斯重回起点,大结局或提前出现?伏笔太多!
63 |
64 | 萨格拉斯
65 |
66 | 争霸艾泽拉斯这个版本,虽然表面上是联盟与部落阵营的一场大冲突,可是在这冲突之下也隐藏着巨大的伏笔!而萨格拉斯最后怒劈艾泽拉斯星球的那把神剑,最后也一定能成为一个重要的“引子”。
67 |
68 | 而两个阵营的冲突更是让我们有很多想不通的疑点,比如希尔瓦娜斯为何火烧泰达希尔?在共同抵御了燃烧军团以后,希女王肯定不会无缘无故的去做贸然撕毁盟约的事情。
69 |
70 | 而最有可能的情况就是,泰达希尔的根部已经被上古之神腐化了,而上古之神就是虚空的爪牙!
71 |
72 | 魔兽世界:争霸艾泽拉斯重回起点,大结局或提前出现?伏笔太多!
73 |
74 | 火烧泰达希尔
75 |
76 | 最后让我们想想魔兽争霸WAR3的开场动画,当联盟和部落在大战一触即发的时候,天空突然被邪能笼罩,漫天开始落下火雨和恶魔......而这样的场景,是否会在“争霸艾泽拉斯”版本的最后出现呢?
77 |
78 | 虚空突然被撕裂,上古之神拔地而起,众神齐聚艾泽拉斯,而艾泽拉斯的星魂成为了最强的泰坦参与战斗,这也许就是魔兽世界的大结局吧! 7月15日
79 | '''
80 | def index(request):
81 | '''
82 | 访问ip或域名跳转到aboutUs页面
83 | :param request:
84 | :return:
85 | '''
86 | return redirect(resolve_url(about_us))
87 |
88 |
89 | def about_us(request):
90 | '''
91 | 返回aboutUS页面
92 | :param request:
93 | :return:
94 | '''
95 | return render(request,'aboutUS.html')
96 |
97 |
98 | def hot_news(request):
99 | '''
100 | 查询热点新闻数据库,
101 | 将返回结果进行分页操作。
102 | :param request:
103 | :return:
104 | '''
105 | info_dict = select() # 查询数据库
106 | for item in info_dict:
107 | print ('12')
108 | print (item)
109 | pageinator = Paginator(info_dict, 6, 2) # 将查询到的结果分页。
110 | page = request.GET.get('page') # 从url里获取参数。
111 |
112 | try:
113 | customer = pageinator.page(page) # 获取当前参数的页面数据。
114 | except PageNotAnInteger:
115 | customer = pageinator.page(1)
116 | except EmptyPage:
117 | customer = pageinator.page(pageinator.num_pages)
118 | return render(request, 'hotNews.html', {'cus_list':customer}) # 渲染模板并返回。
119 |
120 |
121 | def article_analyze(request):
122 | global get_art, classify_list
123 | text = get_art
124 | list = classify_list
125 | if request.method == 'GET':
126 | get_art = ''''''
127 | classify_list = []
128 | return render(request, 'articleAnalyze.html',{'classify': list,'article': article,'get_art': text})
129 |
130 | def get_article(request):
131 | if request.method == 'POST':
132 | global classify_list,get_art
133 | classify_list = []
134 | text = request.POST.get('text') # 获取form里的text。
135 | if len(text.strip()) < 300:
136 | print(len(text.strip()))
137 | classify = '文字小于三百个字符,自动恢复为默认范文1。' # 通过tcp传输文字 并获取返回的分类。
138 | get_art = source
139 | else:
140 | print(len(text.strip()))
141 | get_art = text
142 | classify = sen_info(text) # 通过tcp传输文字 并获取返回的分类。
143 | # classify = '123'
144 |
145 | classify_list.append(classify) # 添加分类。
146 |
147 |
148 |
149 | return redirect(resolve_url(article_analyze)) # 页面跳转。
150 | return redirect(resolve_url(about_us))
151 |
152 |
153 | def page_not_found(request):
154 | return render_to_response('404.html')
155 |
156 |
--------------------------------------------------------------------------------