Skip to content

Commit 84591d9

Browse files
authored
Merge pull request #458 from ajdapretnar/rename-geo
Rename GeoMap to Document Map
2 parents 512f8eb + 81ce103 commit 84591d9

File tree

10 files changed

+44
-44
lines changed

10 files changed

+44
-44
lines changed

doc/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Widgets
2323
widgets/corpusviewer
2424
widgets/wordcloud
2525
widgets/concordance
26-
widgets/geomap
26+
widgets/docmap
2727
widgets/wordenrichment
2828
widgets/duplicatedetection
2929

doc/widgets/docmap.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Document Map
2+
============
3+
4+
Displays geographic locations mentioned in the text.
5+
6+
**Inputs**
7+
8+
- Data: Data set.
9+
10+
**Outputs**
11+
12+
- Corpus: Documents containing mentions of selected geographical regions.
13+
14+
**Document Map** widget shows geolocations from textual (string) data. It finds mentions of geographic names (countries and capitals) and displays distributions (frequency of mentions) of these names on a map. It works with any Orange widget that outputs a data table and that contains at least one string attribute. The widget outputs selected data instances, that is all documents containing mentions of a selected country (or countries).
15+
16+
![](images/DocMap-stamped.png)
17+
18+
1. Select the meta attribute you want to search geolocations by. The widget will find all mentions of geolocations in a text and display distributions on a map.
19+
2. Select the type of map you wish to display. The options are *World*, *Europe* and *USA*. You can zoom in and out of the map by pressing + and - buttons on a map or by mouse scroll.
20+
3. The legend for the geographic distribution of data. Countries with the boldest color are most often mentioned in the selected region attribute (highest frequency).
21+
22+
To select documents mentioning a specific country, click on a country and the widget will output matching documents. To select more than one country hold Ctrl/Cmd upon selection.
23+
24+
Example
25+
-------
26+
27+
**Document Map** widget can be used for simply visualizing distributions of geolocations or for a more complex interactive data analysis. Here, we've queried [NY Times](nytimes.md) for articles on Slovenia for the time period of the last year (2015-2016). First we checked the results with [Corpus Viewer](corpusviewer.md).
28+
29+
![](images/DocMap-Example.png)
30+
31+
Then we sent the data to **Document Map** to see distributions of geolocations by *country* attribute. The attribute already contains country tags for each article, which is why **NY Times** is great in combinations with **Document Map**. We selected Germany, which sends all the documents tagged with Germany to the output. Remember, we queried **NY Times** for articles on Slovenia.
32+
33+
We can again inspect the output with **Corpus Viewer**. But there's a more interesting way of visualizing the data. We've sent selected documents to [Preprocess Text](preprocesstext.md), where we've tokenized text to words and removed stopwords.
34+
35+
Finally, we can inspect the top words appearing in last year's documents on Slovenia and mentioning also Germany with [Word Cloud](wordcloud.md).

doc/widgets/geomap.md

-35
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

doc/widgets/nytimes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ To use the widget, you must enter [your own API key](https://developer.nytimes.c
3232
Example
3333
-------
3434

35-
**NYTimes** is a data retrieving widget, similar to [Twitter](twitter-widget.md) and [Wikipedia](wikipedia-widget.md). As it can retrieve geolocations, that is geographical locations the article mentions, it is great in combination with [GeoMap](geomap.md) widget.
35+
**NYTimes** is a data retrieving widget, similar to [Twitter](twitter-widget.md) and [Wikipedia](wikipedia-widget.md). As it can retrieve geolocations, that is geographical locations the article mentions, it is great in combination with [Document Map](docmap.md) widget.
3636

3737
![](images/NYTimes-Example1.png)
3838

3939
First, let's query **NYTimes** for all articles on Slovenia. We can retrieve the articles found and view the results in [Corpus Viewer](corpusviewer.md). The widget displays all the retrieved features, but includes on selected features as text mining features.
4040

41-
Now, let's inspect the distribution of geolocations from the articles mentioning Slovenia. We can do this with [GeoMap](geomap.md). Unsurprisingly, Croatia and Hungary appear the most often in articles on Slovenia (discounting Slovenia itself), with the rest of Europe being mentioned very often as well.
41+
Now, let's inspect the distribution of geolocations from the articles mentioning Slovenia. We can do this with [Document Map](docmap.md). Unsurprisingly, Croatia and Hungary appear the most often in articles on Slovenia (discounting Slovenia itself), with the rest of Europe being mentioned very often as well.

orangecontrib/text/widgets/icons/GeoMap.svg orangecontrib/text/widgets/icons/DocMap.svg

+1-1
Loading

orangecontrib/text/widgets/owgeomap.py orangecontrib/text/widgets/owdocmap.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ class Map:
3232
('USA', USA))
3333

3434

35-
class OWGeoMap(widget.OWWidget):
36-
name = "GeoMap"
35+
class OWDocMap(widget.OWWidget):
36+
name = "Document Map"
3737
priority = 530
38-
icon = "icons/GeoMap.svg"
38+
icon = "icons/DocMap.svg"
3939

4040
class Inputs:
4141
data = Input("Data", Table)
@@ -91,7 +91,7 @@ def _create_layout(self):
9191
pathname2url(os.path.join(
9292
os.path.dirname(__file__),
9393
'resources',
94-
'owgeomap.html')))
94+
'owdocmap.html')))
9595

9696
class Bridge(QObject):
9797
@pyqtSlot(str)
@@ -200,7 +200,7 @@ def main():
200200
X=np.zeros((len(words), 0)),
201201
metas=words)
202202
app = QApplication([''])
203-
w = OWGeoMap()
203+
w = OWDocMap()
204204
w.on_data(table)
205205
w.show()
206206
app.exec()

0 commit comments

Comments
 (0)