Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7652193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:42:16+00:00 2026-05-31T11:42:16+00:00

I am trying to perform TFIDF on a set of documents (as text files)

  • 0

I am trying to perform TFIDF on a set of documents (as text files) using mahout to do to calculations, following this guide.

I have successfully created the dictionary and vector weights, and am now attempting to access the output. In the guide it says you “can for instance easily load the content of the generated dictionary file into a Map with token index as keys and the tokens as values.”

I am not sure how to go about loading in this file to a map as he suggests, does anybody know how it is done?

I created my vectors from a directory of text files, one issue I encountered when running “./mahout seq2sparse…” was the -a flag that controls the analyser – which should be lucene’s StandardAnalyzer. When trying to run with this flag I received a ClassNotFoundException, but removing the flag solved the problem and I think the default analyser is also this one anyway, therefore the output should be the same as the example.

If anybody knows how to load this dictionary into a map I will be eternally grateful!

James

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:42:18+00:00Added an answer on May 31, 2026 at 11:42 am

    I worked it out, so I am putting this up for anyone that comes across this on google.

            SequenceFile.Reader read = new SequenceFile.Reader(fs, new Path("<path do dictionary>"), conf);
            IntWritable dicKey = new IntWritable();
            Text text = new Text();
            Map<Integer, String> dictionaryMap = new HashMap();
            while (read.next(text, dicKey)) {
                dictionaryMap.put(Integer.parseInt(dicKey.toString()), text.toString());
            }
            read.close();
    

    This worked for me, allowing me to read the mapping of id to text in my dictionary file from mahout.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to perform a complex issue, I have a query structured like this:
When trying to perform the following cast DateTime issueDate = Convert.ToDateTime(binfile.ReadByte()); (reading .dat files
I'm trying perform a relatively basic TCP socket send/receive operation on Windows CE using
I am trying to perform a JNDI-lookup from within the GWT devmode. I have
I'm trying to perform a DISTINCT clause on a query like this SELECT DISTINCT
I am trying to perform a search for documents within a SharePoint site, but
I'm trying to perform a bulk insert a set of rules into a table
I am trying to perform a method in a background thread using a NSOperationQueue
Am trying to perform a select into outfile, am having following errors My request:
I am trying to perform UPDATE action in Gridview(ASP.net). I have created a AccessDataSource

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.