- •Реферат
- •Содержание
- •Введение
- •Постановка задачи
- •1. Профилирование пользователей
- •2. Работа с веб-данными
- •2.1 Источники данных
- •2.2 Обработка данных
- •3. Содержимое на основе профиля пользователя
- •3.1 Управление данными
- •3.2 Профилирование пользователя для веб-просмотра
- •3.3 Классификация данных профиля пользователя
- •3.3.1 Индексация и предобработка
- •3.3.2 Извлечение термов
- •3.3.3 Взвешивание термов с использованием статистических мер
- •3.3.4 Перевод текста в векторное представление
- •3.4 Кластеризация данных профиля пользователя
- •4. Нейронные сети
- •4.1 Функции активации
- •4.2 Функция потерь
- •5 Сверточные нейронные сети
- •5.1 Архитектура сверточной нейронной сети
- •5.1.1 Полносвязный слой
- •5.1.2 Сверточный слой
- •5.1.3 Cубдискретизирующий слой
- •5.1.4 Dropout слой
- •5.2 Модели использования сверточной нейронной сети для классификации текстов
- •5.2.1 Посимвольный подход
- •5.2.2 Подход c использованием кодирования слов
- •6 Использование сверточной нейронной сети для профилирования
- •6.1 Алгоритм при векторной репрезентации слов и текстов
- •6.2 Алгоритм при семантической репрезентации слов и текстов
- •6.3 Результаты работы алгоритмов
- •Заключение
- •Библиографический список
- •Приложение
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
- •Продолжение Приложения
Продолжение Приложения
#!/usr/bin/perl
#script integrates the results of clustering and source text (input_file)
# output_log input_file out
use warnings;
use strict;
use Encode;
sub usage {
print "\nUse: $0 claster_log file out_file\n";
exit 1;
}
usage if ( $#ARGV != 2);
my $log = shift @ARGV;
my $fls = shift @ARGV;
my $f_out = shift @ARGV;
###########################################################
open( F_LOG, $log ) or die "Can't open file: $!";
binmode(F_LOG, ":encoding(UTF-8)");
open( F_IN, $fls ) or die "Can't open file: $!";
binmode(F_IN, ":encoding(UTF-8)");
open( F_OUT, '>', $f_out) or die "Can't open file: $!";
binmode(F_OUT, ":encoding(UTF-8)");
my %tmp=();
while (my $lin =<F_IN>) {
my @t = split "\t", $lin;
if ($#t==1){
my @sym = split(//, $t[1]);
my $str;
if ($#sym > 170){
for(my $x=0; $x<170; $x++) {
$str.= $sym[$x];
}
$str.="...";
}
else{
$t[1]=~s/[\r\n\"]+//;
$str=$t[1];
}
$tmp{$t[0]} = $str;
Продолжение Приложения
}
else{
print "error format...\n$lin\n";
}
}
print F_OUT "cluster_number\tweigth\tIDoc\ttext(limit is 170 symbols)\n";
while (my $line =<F_LOG>) {
if ($line =~ /\S/){
my @str = split ":", $line;
my %h=();
my @cls = split ";", $str[1];
foreach my $cls (@cls){
if ($cls =~ /\d/){
my @one = split " ", $cls;
if(!exists( $h{$one[0]}) ) {
$h{$one[0]} = $one[1];
}
}
}
foreach my $h (reverse sort { $h{$a} <=> $h{$b} } keys %h){
if(exists( $tmp{$h})){
my $cnt=$str[0]+1;
my $wgt=int ($h{$h}*1000);
print F_OUT "$cnt\t$h\t$tmp{$h}\n";
}
}
}
}