semvec/pypi-packages huggingface dataset:
toponym 0.5.1
Extract and count countries and cities (+their synonyms) from text
Requires Python: >=3.6

<p align="center">
<a href="https://github.com/iwpnd/toponym/actions" target="_blank">
    <img src="https://github.com/iwpnd/toponym/workflows/build/badge.svg?branch=master" alt="Build Status">
</a>
<a href="https://codecov.io/gh/iwpnd/toponym" target="_blank">
    <img src="https://codecov.io/gh/iwpnd/toponym/branch/master/graph/badge.svg" alt="Coverage">
</a>
</p>

# Toponym

Build grammatical cases for words in Slavic languages from pre-defined recipes.

**documentation**: [https://toponym.iwpnd.pw/](https://toponym.iwpnd.pw/)  

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Installing

for usage:
```
pip install toponym
```

for development:
```
git clone https://github.com/iwpnd/toponym.git
pip install flit
flit install toponym --symlink
```

# Description

## Problem
In Slavic languages a word can change, depending on how and where it is used within a sentence. The city Moscow (`Москва`) changes to `Москве` when used prepositional.
So when you want to eg. know if:

```python
"Москва" in "В Москве с начала года отремонтировали 3 тысячи подъездов"

>> False
```

## Solution
This is where Toponym comes in. Utilizing pre-defined recipes it naively creates grammatical cases depending on the ending of the input word that the user wants to create Toponyms from. The recipe looks as follows:

### Recipe
```python
recipe = {
    "а": { # ending of the input-word
        "nominative": [[""], 0],
        "genitive": [ # case that we need
            ["ы","и"], # ending of the output-word
            1 # chars to be deleted, before ending of output is added
            ],
        "dative": [["е"], 1],
        "accusative": [["у"], 1],
        "instrumental": [...]
}
```

If multiple endings are given, multiple toponyms with that ending will be created. Some of those created toponyms do not make sense, or are not used in the wild. If you have an idea about how to remove those that are unreal please contact me.

With the built toponyms for you can now check:

```python
from toponym.recipes import Recipes
from toponym.toponym import Toponym

recipes_russian = Recipes()
recipes_russian.load_from_language(language='russian')

city = "Москва"

t = Toponym(input_word=city, recipes=recipes_russian)
t.build()

print(t.list_toponyms())
>> ['Москвой', 'Москвы', 'Москви', 'Москве', 'Москву', 'Москва']

any([word in "В Москве с начала года отремонтировали 3 тысячи подъездов" for word in tn.list_toponyms()])
>> True
```


### supported languages:

```
full name		iso code
croatian		hr
russian		    ru
ukrainian		uk
romanian		ro
latvian		    lv
hungarian		hu
greek		    el
polish		    pl
```

## Running the tests

```
pytest toponym/tests/
```
gnn 1.1.9
Graph Neural Network Tensorflow implementation

Graph Neural Network Model
==========================

This repo contains a Tensorflow implementation of the Graph Neural Network model.


- **Website (including documentation):** https://mtiezzi.github.io/gnn_site/
- **Authors:** `Matteo Tiezzi <http://sailab.diism.unisi.it/people/matteo-tiezzi/>`_, `Alberto Rossi <http://sailab.diism.unisi.it/people/alberto-rossi/>`_

Install
-------

Requirements
^^^^^^^^^^^^
The GNN framework requires the packages **tensorflow**, **numpy**, **scipy**.


To install the requirements you can use the following command
::


      pip install -U -r requirements.txt


Install the latest version of GNN::

      pip install gnn


For additional details, please see `Install <https://mtiezzi.github.io/gnn_site/install.html>`_.

Simple usage example
--------------------

::

        import gnn.GNN as GNN
        import gnn.gnn_utils
        import Net as n

        # Provide your own functions to generate input data
        inp, arcnode, nodegraph, labels = set_load()

        # Create the state transition function, output function, loss function and  metrics 
        net = n.Net(input_dim, state_dim, output_dim)

        # Create the graph neural network model
        g = GNN.GNN(net, input_dim, output_dim, state_dim)

        #Training

        for j in range(0, num_epoch):
            g.Train(inp, arcnode, labels, count, nodegraph)

            # Validate            
            print(g.Validate(inp_val, arcnode_val, labels_val, count, nodegraph_val))


Citing
------

To cite the GNN implementation please use the following publication::

    Rossi, A., Tiezzi, M., Dimitri, G.M., Bianchini, M., Maggini, M., & Scarselli, F. (2018).
    "Inductiveâ€“Transductive Learning with Graph Neural Networks", 
    In Artificial Neural Networks in Pattern Recognition (pp.201-212). 
    Berlin : Springer-Verlag.

Bibtex::

    @inproceedings{rossi2018inductive,
      title={Inductive--Transductive Learning with Graph Neural Networks},
      author={Rossi, Alberto and Tiezzi, Matteo and Dimitri, Giovanna Maria and Bianchini, Monica and Maggini, Marco and Scarselli, Franco},
      booktitle={IAPR Workshop on Artificial Neural Networks in Pattern Recognition},
      pages={201--212},
      year={2018},
      organization={Springer}
    }


To cite GNN please use the following publication::

    F. Scarselli, M. Gori,  A. C. Tsoi, M. Hagenbuchner, G. Monfardini, 
    "The Graph Neural Network Model", IEEE Transactions on Neural Networks,  
    vol. 20(1); p. 61-80, 2009.

Bibtex::

    @article{Scarselli2009TheGN,
      title={The Graph Neural Network Model},
      author={Franco Scarselli and Marco Gori and Ah Chung Tsoi and Markus Hagenbuchner and Gabriele Monfardini},
      journal={IEEE Transactions on Neural Networks},
      year={2009},
      volume={20},
      pages={61-80}
    }





License
-------

Released under the 3-Clause BSD license (see `LICENSE.txt`)::

   Copyright (C) 2004-2019 Matteo Tiezzi
   Matteo Tiezzi <mtiezzi@diism.unisi.it>
   Alberto Rossi <alrossi@unifi.it>