Question

I have 2 tables in my Oracle database:

  1. DF (term, doccount)
  2. TF (abstractid, term, freq)

One for Document frequency(DF) having terms and documentCount and another table for term frequency called TF havind the documentID, terms, Frequency. I want to calculate TF*IDF where TF = number of times that a term appears in an article (frequency column from table TF) and IDF = log (132225)-log(docCount)+1

I want to store my result in a table (TFIDF) having documentID, Terms and the calculated TF*IDF

Any ideas?

Was it helpful?

Solution

You need to join your TF and DF tables and then insert into the destination TFIDF table. Try this:

insert into TFIDF (documentID, terms, tf_idf)
select abstractID, df.term, (log(10, 132225)-log(10, doccount)+1)*(tf.freq)
from tf, df
where tf.term = df.term;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top