Numeric Fused-Head
This is the code used in the paper:
"Where’s My Head? Definition, Dataset and Models for Numeric Fused-Heads Identification and Resolution" Yanai Elazar and Yoav Goldberg
to appear in TACL
Installation
Installing the num_fh package is simple as:
pip install num_fh
Prerequisites
- at least python 3.6 (and specific libraries in the requirements.txt)
We strongly recommend that you use a new virtual environment to install num_fh
create a clean conda env
conda create -n nfh python==3.6 anaconda
source activate nfh
Cloning and Running the Library by Yourself
clone this repo:
git clone git@github.com:yanaiela/num_fh.git
installing python packages
pip install -r requirements.txt
Example Usage
import spacy
from num_fh import NFH
nlp = spacy.load('en_core_web_sm')
nfh = NFH(nlp)
nlp.add_pipe(nfh, first=False)
doc = nlp("I told you two, that only one of them is the one who will get 2 or 3 icecreams")
assert doc[16]._.is_nfh == True
assert doc[18]._.is_nfh == False
assert doc[3]._.is_deter_nfh == True
assert doc[16]._.is_deter_nfh == False
assert len(doc._.nfh) == 4
The paper (and therefore, also the code) deals with two sub-tasks of the FH solution:
- Identification
- Resolution
These are dealt with separately, and discussed in the paper in sections (3,4) and (5,6). These parts are also solved separately in the code, and contain further instructions for each one in dedicated README files: Identification and Resolution
Demo
To run the demo, run the following:
export FLASK_APP=num_fh/demo/server.py
flask run --port 5000 --host ""
Citing
If you find this work relevant to yours, please consider citing us:
@misc{elazar2019wheres,
title={Where's My Head? Definition, Dataset and Models for Numeric Fused-Heads Identification and Resolution},
author={Yanai Elazar and Yoav Goldberg},
year={2019}
}
Contact
If you have any question, issue or suggestions, feel free to contact us with the emails listed in the paper.
Metadata
Release files for num-fh 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| num_fh-1.1.1.tar.gz | 23.0 kB | Without provenance | Details for num_fh-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| num_fh-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for num_fh-1.1.1-py3-none-any.whl |
Total release size: 56.7 kB
Release files / num_fh-1.1.1.tar.gz
| Download URL | num_fh-1.1.1.tar.gz |
|---|---|
| Size | 23.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e938d0f3b982d5a52cfbe62b3be5379fefb47813f186b278809ca53a3f333b65
|
|
BLAKE2b-256 checksum How to use checksums |
a19d4ae9fbfeb52a701346e80d8b9df1a595f6d9fa17ded0a725c2878ccc8ffd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.16
|
Release files / num_fh-1.1.1-py3-none-any.whl
| Download URL | num_fh-1.1.1-py3-none-any.whl |
|---|---|
| Size | 33.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b96a084d1c1d05dc6e9952d008ad9b536aa01736cab7ef9030da2650df958559
|
|
BLAKE2b-256 checksum How to use checksums |
a21a3a30ffdce0d287dea8957850e0b542fe061894841a053f49b2ed15828a15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.16
|
Security for num-fh 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.