Git Product home page Git Product logo

wikipedia-map's Issues

Show All Links of full Article as Nodes

Hallo,
My colleagues and I regularly play a game where the goal is to find the shortest path between two Wikipedia articles. I found this software to enable a checking function. Therefore, I have two questions:

Is it possible to extract all links within an article using this script?
Is it possible to display all links as nodes?

Start flask server

Hi, I am running flask on python2.7. Is the code for the localserver gone? I cant find the api/api.py anymore :(

Regards

Node shows edge to self

When you enter facebook as one of your search terms, the main topic node will show an edge to itself

Doesn't work

Hi, I'd like to see your page in action but unfortunately it doesn't seem to work.
I type an article then press go but it remains in the "tour" section.

More minor unicode problems

There are still some minor issues with unicode:

  • Typing unicode characters in the top bar will return an error
  • When get_page_name results in unicode characters, they're left out of the node title:

Unicode problems with random button

I've got the random button working for special characters like , and and., but it still doesn't work well for very strange characters. For example, there's a severe display bug with wikipedia page titles like "Dąbrowice, Gmina Maków." In the text box, it displays with a HTML character encoding (the second character displays asą, with the full text ofDąbrowice, Gmina Mak�w), and on the node it displays like

screen shot 2016-03-06 at 4 23 55 pm

It is likely that this is in part Python's fault, and also JavaScript's fault as well. I'll try to fix it.

remove all nodes with only one connection

It would be nice if there was a way to simplify a graph by removing all nodes with only one connection. This would allow you to build a complex, meaningful network fairly quickly (explore a few things, find some connections, then delete the guff).

It would also be nice to be able to manually delete selected nodes somehow.

executing `api/api.py`

Hi,
i have the error below when i try to execute >python api.py to run the flask server.

Traceback (most recent call last):
File "api.py", line 10, in
from wikipedia_parse import *
File "C:\WikiMap\wikipedia-map-master\api\wikipedia_parse.py", line 164
print is_article(":Cows"), is_article("WP:UA") # Test if it's an article
^
SyntaxError: invalid syntax

Thank you in advance for your help

Feature: Add next terms

It would be great if it was possible to add a term after initial search without losing connections - e.g. for brainstorming purposes.

Great tool, btw - really appreciate

"Geographic Coordinates System" marked as only link for many pages about places

Recently it seems the structure of many pages has changed such that the box indicating the coordinates of a place is contained within the first direct p descendant of .mw-parser-output. This causes "Geographic Coordinate System" to be marked as the only link from all of these articles.
screen shot 2018-04-30 at 10 49 43 am
In this image, highlighted p node contains the coordinates information, but is structurally the first p node that is a direct child of .mw-parser-output

Direct linking to graphs

Coming from erabug/wikigraph#2 and fedwiki/wiki#63 we know that linking to certain states of the graph would be interesting.

Similar to what CoGraph allows, but by using URL fragments known from @fedwiki lineups.

If I searched for Space and Time, they'd automatically be added to the URL and therefore create a stable view onto the data. Those nodes should be expanded by default on load.

Duplicate Nodes.

Problem

Sometimes, in a graph, the same node is shown twice. In this graph, you can see that J.K. Rowling is shown twice, once with a space between initials, and once without; both "J. K. Rowling" and "J.K. Rowling".

Cause

This is because one page links to https://en.m.wikipedia.org/wiki/J._K._Rowling, while the other links to https://en.m.wikipedia.org/wiki/J.K._Rowling. These both redirect to the same page, but are different URLs. Therefore, wikipedia_parse.py, which only looks at the last segment of the URL, interprets them differently.

Possible solutions

Look at the actual title of pages, after following the link, call get_page_name on each node that is added. This would be very slow, better to pursue a faster method.

some cases could be solved by simply storing a lowercased version of page titles with spaces removed as node IDs, and using the full thing for node labels. However, this still would not resolve things like Cat vs Cats, which go to the same page but might be linked differently.

Data Source for the Map

Hi,

Can you please let me know the data source which you are using in the Flask Server API?

Thanks,

Lag in traceback

In very large networks, the traceback can sometimes be very slow. The whole network pauses during slow tracebacks.

A hackish solution could be to call traceBack asynchronously from a setTimeout call, which might not freeze the network in the same way. However, this would address the symptoms rather than the problem, and not actually improve the speed.

A much better solution would be to increase speed by reducing the number of iterations that are made through the traceback nodes. Right now, 6 iterations are made:

  1. Iterate through parents to identify traceback nodes
  2. Iterate through identified nodes to adjust color
  3. Iterate through identified nodes again inside vis.DataSet.update
  4. Iterate through parents to identify traceback edges
  5. Iterate through identified edges to adjust color
  6. Iterate through the edges again inside vis.DataSet.update

Looking into the code for vis.DataSet.update, it appears that commit dfc633e was made in error. This added two more iterations to the list, further slowing down the traceback, rather than speeding it up.

To bring this down to one loop, traceBack, getTraceBackNodes, and getTraceBackEdges could be merged into a single function with one iteration. nodes.update() and edges.update() could be called once for each item as they are identified and modified. This could bring the total loops made through the same data during a traceBack down to one.

Get more links for selected nodes

The current script gets the links from the first paragraph, but this is sometimes not particularly useful. For example, Dog only returns "Carl Linnaeus" (this might be a bug though, because the first paragraph of https://en.wikipedia.org/wiki/Dog has more links than that..).

It would be good to be able to (optionally) use more paragraphs to rip links from, so that nodes with weak first paragraphs can be expanded..

Also, I wonder if it wouldn't be better to use the first 3 paragraphs by default. I have a local copy that gets the first three, and it seems to capture a much more representative set of links..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.