tagging

Scaling Web Applications and Tagging - Digg, Del.icio.us, StackOverflow

拟墨画扇 提交于 2019-11-30 04:07:10
How do websites like Digg, Del.icio.us, and StackOverflow implement tagging? I know this other question has an accepted answer of a many-to-many relation with a cross ref table. But how do the "big boys" do it? The same way? How is it scaling? Rex M Here is the oft-quoted article which breaks down tagging schemas by real performance metrics: http://tagging.pui.ch/post/37027746608/tagsystems-performance-tests The author notes that the founder of delicious explains using an RDBMS for tagging simply does not scale to many millions of items under load. An alternative like Lucene may fit better in

Union and Intersect in Django

我怕爱的太早我们不能终老 提交于 2019-11-29 23:54:00
class Tag(models.Model): name = models.CharField(maxlength=100) class Blog(models.Model): name = models.CharField(maxlength=100) tags = models.ManyToManyField(Tag) Simple models just to ask my question. I wonder how can i query blogs using tags in two different ways. Blog entries that are tagged with "tag1" or "tag2": Blog.objects.filter(tags_in=[1,2]).distinct() Blog objects that are tagged with "tag1" and "tag2" : ? Blog objects that are tagged with exactly "tag1" and "tag2" and nothing else : ?? Tag and Blog is just used for an example. You could use Q objects for #1: # Blogs who have

how can i create a tagging system using php and mysql?

血红的双手。 提交于 2019-11-29 20:08:42
wondering how i can create a tagging system in php and with a mysql database, my initial thoughts were to create a row in the table where the articles are stored, named tags, and list the tags seperated by commas, but i am not sure how i can create a query that searches for matching tags, i dont want to have to query every article everytime someone clicks a tag. can anyone help? You're describing a many-to-many relationship between Articles and Tags. You'd want to use an intermediate junction table to resolve that relationship. Now, to find all articles that match a selected tag: SELECT a

How to auto-tag content, algorithms and suggestions needed

对着背影说爱祢 提交于 2019-11-29 18:57:43
I am working with some really large databases of newspaper articles, I have them in a MySQL database, and I can query them all. I am now searching for ways to help me tag these articles with somewhat descriptive tags. All these articles is accessible from a URL that looks like this: http://web.site/CATEGORY/this-is-the-title-slug So at least I can use the category to figure what type of content that we are working with. However, I also want to tag based on the article-text. My initial approach was doing this: Get all articles Get all words, remove all punctuation, split by space, and count

Facial recognition/detection PHP or software for photo and video galleries

夙愿已清 提交于 2019-11-29 18:43:55
I have a very large photo gallery with thousands of similar people, objects, locations, things. The majority of the people in the photos have their own user accounts and avatar photos to match. There are also logical short lists of people potentially in the photo based on additional data available for each photo. I allow users to tag photos with their friends and people they know but an automated process would be better. I've used photo tagger/finder from face.com integrating with Facebook photos and the Google Picasa photo tagger for personal albums also does the same thing and is exactly

‘Machine tags’ referencing model instances in Django

故事扮演 提交于 2019-11-29 18:02:13
Example problem Say, you have models Publication , Photo , Event and Person ; they could relate to each other in different ways. Particularly, publications can have 1) some illustrations (related photos) and 2) some mentioned personas. Events can have some 3) photos and 4) people related as well. Also, 5) events could be mentioned in publications. No additional data needs to be associated with relationships, except for illustrations: they need a position field for sorting. So in that case (#1), it's OK to go with intermediate model like Illustration referencing photo and publication and

Best DB (MySQL) structure: Articles which contain favored tags

♀尐吖头ヾ 提交于 2019-11-29 16:00:46
问题 I've built a news site: - The articles are shown on the front page ordered by date. The newest one first. - The news are in the table "news" with the fields "id", "title", "text" and some other ones. - All articles are tagged with 1-5 relevant tags. - The tags are in the table "tags" with the fields "id", "tag", "article" and some other ones. - The field "article" of "tags" fits to the field "id" of "news". Now I want to give the user the opportunity to add tags to his "favored tags list".

MySQL / PHP: Find similar / related items by tag / taxonomy

*爱你&永不变心* 提交于 2019-11-29 02:32:56
问题 I have a cities table which looks like this. |id| Name | |1 | Paris | |2 | London | |3 | New York| I have a tags table which looks like this. |id| tag | |1 | Europe | |2 | North America | |3 | River | and a cities_tags table: |id| city_id | tag_id | |1 | 1 | 1 | |2 | 1 | 3 | |3 | 2 | 1 | |4 | 2 | 3 | |5 | 3 | 2 | |6 | 3 | 3 | How do I calculate which are the most closely related city? For example. If I were looking at city 1 (Paris), the results should be: London (2), New York (3) I have

Rails 3 Order By Count on has_many :through

风流意气都作罢 提交于 2019-11-29 02:07:06
I have an application where I can list Items and add tags to each Item. The models Items and Tags are associated like this: class Item < ActiveRecord::Base has_many :taggings has_many :tags, :through => :taggings end class Tagging < ActiveRecord::Base belongs_to :item belongs_to :tag end class Tag < ActiveRecord::Base has_many :taggings has_many :items, :through => :taggings end So, this many-to-many relationship allows me to set n tags for each Item, and the same tag can be used several times. I'd like to list all tags ordered by the number of items associated with this tag. More used tags,

Python NLTK: How to tag sentences with the simplified set of part-of-speech tags?

前提是你 提交于 2019-11-28 19:16:23
Chapter 5 of the Python NLTK book gives this example of tagging words in a sentence: >>> text = nltk.word_tokenize("And now for something completely different") >>> nltk.pos_tag(text) [('And', 'CC'), ('now', 'RB'), ('for', 'IN'), ('something', 'NN'), ('completely', 'RB'), ('different', 'JJ')] nltk.pos_tag calls the default tagger, which uses a full set of tags. Later in the chapter a simplified set of tags is introduced. How can I tag sentences with this simplified set of part-of-speech tags? Also have I understood the tagger correctly, i.e. can I change the tag set that the tagger uses as I'm