Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ICLRandD/Blackstone
/ functions
Functions
54 in github.com/ICLRandD/Blackstone
⨍
Functions
54
◇
Types & classes
7
↳
Endpoints
6
↓ 11 callers
Function
find_abbreviation
Implements the abbreviation detection algorithm in "A simple algorithm for identifying abbreviation definitions in biomedical text.", (Schwar
blackstone/pipeline/abbreviations.py:19
↓ 6 callers
Function
contains
Check whether sequence str contains ANY of the items in set.
blackstone/pipeline/abbreviations.py:92
↓ 4 callers
Function
filter_matches
( matcher_output: List[Tuple[int, int, int]], doc: Doc )
blackstone/pipeline/abbreviations.py:97
↓ 4 callers
Function
set_provision_target
Returns the legislation.gov.uk URL for the identified provision, e.g. http://www.legislation.gov.uk/ukpga/1998/42/section/20.
blackstone/utils/legislation_linker.py:126
↓ 3 callers
Function
extract_legislation_relations
Extract relationships between provisions and instruments identified by Blackstone's NER with the assistance of the dependency parser. Th
blackstone/utils/legislation_linker.py:52
↓ 3 callers
Method
find
Functional version of calling the matcher for a single span. This method is helpful if you already have an abbreviation which
blackstone/pipeline/abbreviations.py:177
↓ 3 callers
Function
set_legislation_target
Returns the legislation.gov.uk for the identified instrument, e.g. http://www.legislation.gov.uk/ukpga/1999/17/contents. The legislation
blackstone/utils/legislation_linker.py:99
↓ 2 callers
Function
filter_spans
Filter out overlapping spans. Returns a list of Spans.
blackstone/utils/legislation_linker.py:27
↓ 2 callers
Method
find_matches_for
( self, filtered: List[Tuple[Span, Span]], doc: Doc )
blackstone/pipeline/abbreviations.py:204
↓ 2 callers
Function
has_numbers
Check if the provision candidate contains a digit.
blackstone/utils/legislation_linker.py:45
↓ 2 callers
Function
mock_set_legislation_target
set_legislation_target makes requests to a website, which we shouldn't run in automated tests.
tests/test_legislation_linker.py:12
↓ 1 callers
Function
compute_vectors
Builds word embeddings using gensim Word2Vec. This function takes a file contained single sentences per line and writes the computed vect
scripts/train_vectors.py:17
↓ 1 callers
Function
create_model
(lang, probs, oov_prob, vectors_data, vector_keys, expand_vectors, prune_vectors)
scripts/init_model.py:106
↓ 1 callers
Function
merge_counts
Merge a number of frequency counts generated from `count_frequencies` into a single file, written to `output_path`.
scripts/word_freqs.py:57
↓ 1 callers
Function
most_similar
(word)
examples/vectors.py:10
↓ 1 callers
Function
open_file
Handle .gz, .tar.gz or unzipped files
scripts/init_model.py:90
↓ 1 callers
Function
parallelize
(func, iterator, n_jobs)
scripts/word_freqs.py:52
↓ 1 callers
Function
process_request
examples/blackstream.py:12
↓ 1 callers
Function
process_text
(text)
examples/blackstream.py:24
↓ 1 callers
Function
read_freqs
(freqs_loc, max_length=100, min_doc_freq=5, min_freq=50)
scripts/init_model.py:168
↓ 1 callers
Function
read_vectors
(vectors_loc)
scripts/init_model.py:151
↓ 1 callers
Function
short_form_filter
(span: Span)
blackstone/pipeline/abbreviations.py:144
↓ 1 callers
Method
sum_iterable
(self, i)
tests/test_sentence_segmenter.py:20
↓ 1 callers
Function
token_in_match_range
(token, matches)
blackstone/pipeline/sentence_segmenter.py:88
↓ 1 callers
Function
trim_entity_spans
The training data is derived from sources that have a fair bit of errant whitespace. This function takes a list of annotations and trims nau
scripts/train_ner.py:30
↓ 1 callers
Function
trim_entity_spans
(data: list)
scripts/simple_training.py:24
Method
__call__
(self, doc: Doc)
blackstone/pipeline/compound_cases.py:40
Method
__call__
(self, doc: Doc)
blackstone/pipeline/concepts.py:36
Method
__call__
(self, doc: Doc)
blackstone/pipeline/abbreviations.py:192
Method
__call__
(self, doc)
blackstone/pipeline/sentence_segmenter.py:18
Method
__init__
(self, nlp)
blackstone/pipeline/compound_cases.py:26
Method
__init__
(self, nlp)
blackstone/pipeline/concepts.py:28
Method
__init__
(self, nlp)
blackstone/pipeline/abbreviations.py:167
Method
__init__
(self, vocab, boundary_protection_rules=[])
blackstone/pipeline/sentence_segmenter.py:13
Function
count_frequencies
Given a file containing single documents per line (in this case, sentences for the ICLR case law corpus), split the text using a science
scripts/word_freqs.py:32
Function
get_sort_key
(span: Span)
blackstone/utils/legislation_linker.py:32
Function
init_model
Create a new model from raw data, like word frequencies, Brown clusters and word vectors.
scripts/init_model.py:54
Function
main
Load the model, set up the pipeline and train the entity recognizer.
scripts/train_ner.py:63
Function
main
(sent_loc: Path, output_dir: Path)
scripts/train_vectors.py:37
Function
main
(raw_dir: Path, output_dir: Path, n_jobs=2)
scripts/word_freqs.py:77
Function
main
Load the model, set up the pipeline and train the entity recognizer.
scripts/simple_training.py:56
Function
main
Create a JSONL patterns file from a terminology list for use in Prodigy and spaCy's EntityRuler. This function receives a spaCy model, th
scripts/rule_builder.py:22
Method
setUp
(self)
tests/test_sentence_segmenter.py:8
Method
setUp
(self)
tests/test_legislation_linker.py:23
Method
setUp
(self)
tests/test_abbreviation.py:13
Method
test_citation
(self)
tests/test_sentence_segmenter.py:14
Method
test_containsQuotes
(self)
tests/test_abbreviation.py:21
Method
test_extract_legislation_relations
(self)
tests/test_legislation_linker.py:68
Method
test_filter_matches
(self)
tests/test_abbreviation.py:99
Method
test_filter_spans
(self)
tests/test_legislation_linker.py:28
Method
test_find
(self)
tests/test_abbreviation.py:116
Method
test_find_abbreviation
(self)
tests/test_abbreviation.py:63
Method
test_set_legislation_target
(self)
tests/test_legislation_linker.py:43
Method
test_set_provision_target
(self)
tests/test_legislation_linker.py:55