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 8082793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:14:13+00:00 2026-06-05T17:14:13+00:00

Okay – I have a dilemma. So far my script converts page titles into

  • 0

Okay – I have a dilemma. So far my script converts page titles into categories. This is based on keywords, and when there is a match a certain score is added, I.e some words hold the value of 10, some only 1. This gets accumulated into a total score for each category.

[{15: [32, 'massages']}, {45: [12, 'hair-salon']}, {23,:[3, 'automotive service']}]

Index being the category id, first value the score second value the category.

In some instances this spans to over 10 category matches.

How can I filter this to only the top 60-75%

I.e clearly massages and hair salon are the most as they are well above automotive service. But how can this intelligence we use be programmed?

I was thinking stddev could help?

Edit

I am trying to filter out low scoring items e.g.

data = [{15: [32, 'massages']}, {45: [1, 'hair-salon']}, {23:[1, 'automotive service']}]]

Massages is the only high scoring item in this instance

data = [{15: [4, 'massages']}, {45: [2, 'hair-salon']}, {23:[1, 'automotive service']}]]

Stil massages

data = [{15: [10, 'massages']}, {45: [50, 'hair-salon']}, {23:[5, 'automotive service']}]]

Now hair-salon (as it is well above others)

So I need not take the first (N) objects, moreso, the first objects that are x higher then other numbers as a percentage or form of standard deviation.

So 50 is much higher then 10 and 5

10 is much higher then 3 or 2

However 9, 8 and 6 are much the same

  • 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-06-05T17:14:17+00:00Added an answer on June 5, 2026 at 5:14 pm
    yourdata = [{15: [32, 'massages']}, {45: [12, 'hair-salon']}, {23:[3, 'automotive service']}]
    
    # transfer your data into a more usable format
    data = [(score,cat,name) for dat in yourdata for cat,(score,name) in dat.iteritems()]
    
    # sort on descending score
    data.sort(reverse=True)
    
    # throw away the low-scoring items
    data = data[:int(len(data)*0.6 + 1)]
    

    returns

    [(32, 15, 'massages'), (12, 45, 'hair-salon')]
    

    (the two highest-scoring items)

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

Sidebar

Related Questions

Okay i have this problem with every page i make. im not sure what
Okay, I have done a bit of searching online and found this thread, but
Okay, none of the previous questions I have seen with this error seem to
Okay so my question is this. Say I have a simple C++ code: #include
Okay so here is my database: I have a page on my .net form
Okay let me do a better job explaining this. Assume I have a person
Okay so I have two import pieces of code involved in this. This first
Okay, so I have my post.php page. If you are not logged in, you'll
okay i have been trying to understand this for hours i am learning VB
Okay so say I have a form element like this: HTML: <div class=form-item> <label>Current

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.