Skip to main content

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

preprint demo

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

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.

Release files for num-fh 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for num-fh 1.1.0
File Size Uploaded
num_fh-1.1.0.tar.gz 22.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for num-fh 1.1.0
File Interpreter ABI Platform
num_fh-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 53.4 kB

Release files / num_fh-1.1.0.tar.gz

Download URL num_fh-1.1.0.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a47adbf48be09b4bd54e6d7dc6a50f4ea839bbe553d860fdeca07448255af31a
BLAKE2b-256 checksum
How to use checksums
1638855baa28c56e265f20123510134a5eb99030f07fb8e2205bc750cfb4fc93
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.32.1 CPython/3.7.3

Release files / num_fh-1.1.0-py3-none-any.whl

Download URL num_fh-1.1.0-py3-none-any.whl
Size 31.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d4b9daae786f493097378078fd0b27e4d895e53ead0f671636f4cb6c297c86b
BLAKE2b-256 checksum
How to use checksums
c771c0d4fe534604e3141db96c3d677d44f797ed7e48eb22fd9256b4255d7ff3
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.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

1.1.1

2 release files

This release

1.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page