There are several issues you need to address:

  1. Extracting the text
  2. Detecting the words
  3. Eliminating noise words
  4. Finding word frequencies

Of those steps the last is the easiest:

use strict; use warnings; my $words = <<WORDS; i have a large mass of files mostly pdf that i want to reorganize base +d on keyword frequency as a first step i obviously need to analyze each fil +e basically i'd like to so something akin to what in sas is called a pro +c freq on each file and extract a list of the top 10 keywords for each those +stats would be plugged into a spreadsheet, which would be parsed separately eventually any suggestions on links on how to get started on this than +ks in advance WORDS my %freq; ++$freq{$_} for split /\s+/, $words; print "$_: $freq{$_}\n" for sort {$freq{$b} <=> $freq{$a}} keys %freq;

Prints (in part):

on: 5 to: 5 a: 5 each: 3 i: 3 file: 2 of: 2 would: 2 in: 2 be: 2 want: 1 which: 1 files: 1 thanks: 1 that: 1 keywords: 1 i'd: 1 eventually: 1 mostly: 1

For steps 2 and 3 you should take a look at the Lingua area of CPAN. For example Lingua::EN::Splitter may help extract words. Lingua::EN::StopWords may help remove noise words.

True laziness is hard work

In reply to Re: extracting keyword frequency from files by GrandFather
in thread extracting keyword frequency from files by svend_ok

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.