Skip to content

Commit 8093eb6

Browse files
authored
Merge pull request creativecommons#109 from soccerdroid/master
CC catalog visualization project - 3rd blog post
2 parents 72bf5cd + 2cc5c4f commit 8093eb6

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
title: Visualize CC Catalog data - data processing part 2
2+
---
3+
categories:
4+
announcements
5+
cc-catalog
6+
product
7+
gsoc
8+
gsoc-2019
9+
open-source
10+
---
11+
author: soccerdroid
12+
---
13+
pub_date: 2019-07-26
14+
---
15+
body:
16+
17+
This is a continuation of my last blog post about the data processing part of the CC-data catalog visualization project. I recommend you to read that [last post](https://opensource.creativecommons.org/blog/entries/cc-datacatalog-data-processing/) for a better understanding of what I'll explain here.
18+
19+
20+
### The data
21+
22+
Every dataset needs cleasing and pre processing operations before their analysis. In order to implement validations, I have to know first with what kind of inconsistencies I would deal with. Here are some interesting insights about the dataset:
23+
24+
- There are several cases where the provider_domain has not referenced a correct cc_license path. We might say then, that not everybody has a clear understading of how to give CC license attributions correctly.
25+
- I found a case where the links json was malformed. It had a huge paragraph as key (instead of a domain). I wasn't expecting something like that hehe.
26+
- There are both types of entries, a provider domain with a small image quantity and a lot of links, and with a huge amount of images but few links. Some of the domains with a lot of images belong to online shops or news websites.
27+
28+
Aside from the above, I have had to face with almost empty lines(meaning just a single column had information), columns bad separated (not a single but more than one tab between the columns), and some other usual problems of a real and non perfect dataset. I have made validations to catch these inconsistencies.
29+
30+
### Data aggregation
31+
It is needed to aggregate the data by provider_domain, in order to get the complete information of every node. Aggregating the images column is simple, as I only have to sum the values in that column. Now the links column is a little bit tricky to be aggregated. We have to remember that this field contains dictionaries, with domains as keys and the times they have been referenced to as values. So for aggregating this column, I need to:
32+
- Create an empty dictionary
33+
- Loop through every key and save it
34+
- If I face with a key that is already in the dictionary, just sum the value that I currently hold to the existing value in the dictionary.
35+
36+
Then, I have to extract creativecommons from the final links dictionary, and put the value into another column, called _Licences\_qty_. This is because the quantity of links to [creativecommons.org](creativecommons.org) can tell us how many licenses the provider_domains uses.
37+
38+
We also need to aggregate the licences column. The goal is to have a data structure that contains the licenses types the provider_domain uses, and to know how many licenses per each license type the provider_domain has.
39+
To achieve this, I:
40+
- Create an empty dictionary of licences
41+
- For each license, create a tuple (license_name,version), which will be a key in the dictionary
42+
- Check if the key exists in the dictionary. If it doesn't, the key is added, with an initial value of 1, to the dictionary.
43+
- If the key exists, increment the value in 1.
44+
45+
At the end, we will have rows like the following:
46+
<div>
47+
<img src="row.png" alt="Example row of the processed dataset"/><br/>
48+
<small class="muted">Example row, with data aggregated. </small>
49+
</div>
50+
<br>
51+
52+
### Considerations and future challenges
53+
54+
I mentioned before that there are provider domains with a lot of images and a few links, and vice versa. As I still have to prune and filter data, I can develop a rule to exclude the domains that are not relevant to the graph. This relevance can be determined by the quantity of images and/or links. My thought with the rules are the following:
55+
56+
- Exclude domains that have a lot of images but few links (less than 20 links).
57+
- Exclude domains that have few images(less than 100) and few links (less than 20)
58+
- Exclude domains that have no links (is not a targeted node).
59+
- Exclude domains that are social networks (Facebook, Instagram, Twitter), as they might not give relevant insights. Most of the references to these SN's are found because the provider domain gives the user the option to share a content.
60+
61+
The thresholds for the quantity of images and links are my intuitions from having seen the data and manually checking some provider domains. If it is possible I could validate it with some data analysis (checking average, maximum and minimum values of the columns).
62+
63+
### Coming soon
64+
65+
- Extraction of unique nodes, and links.
66+
- Visualization with the data.
67+
- Development or modification of pruning/filtering rules.
68+
69+
You can follow the project development in the [Github repo](https://github.com/creativecommons/cccatalog-dataviz).
70+
71+
CC Data Catalog Visualization is my GSoC 2019 project under the guidance of [Sophine
72+
Clachar](https://creativecommons.org/author/sclachar/), who has been greatly helpful and considerate since the GSoC application period. Also, my backup mentor, [Breno Ferreira](https://creativecommons.org/author/brenoferreira/), and engineering director [Kriti
73+
Godey](https://creativecommons.org/author/kriticreativecommons-org/), have been very supportive.
74+
75+
Have a nice week!
76+
77+
Maria
78+
79+
80+
Loading

0 commit comments

Comments
 (0)