MCPcopy Create free account

hub / github.com/ICLRandD/Blackstone / functions

Functions54 in github.com/ICLRandD/Blackstone

↓ 11 callersFunctionfind_abbreviation
Implements the abbreviation detection algorithm in "A simple algorithm for identifying abbreviation definitions in biomedical text.", (Schwar
blackstone/pipeline/abbreviations.py:19
↓ 6 callersFunctioncontains
Check whether sequence str contains ANY of the items in set.
blackstone/pipeline/abbreviations.py:92
↓ 4 callersFunctionfilter_matches
( matcher_output: List[Tuple[int, int, int]], doc: Doc )
blackstone/pipeline/abbreviations.py:97
↓ 4 callersFunctionset_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 callersFunctionextract_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 callersMethodfind
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 callersFunctionset_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 callersFunctionfilter_spans
Filter out overlapping spans. Returns a list of Spans.
blackstone/utils/legislation_linker.py:27
↓ 2 callersMethodfind_matches_for
( self, filtered: List[Tuple[Span, Span]], doc: Doc )
blackstone/pipeline/abbreviations.py:204
↓ 2 callersFunctionhas_numbers
Check if the provision candidate contains a digit.
blackstone/utils/legislation_linker.py:45
↓ 2 callersFunctionmock_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 callersFunctioncompute_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 callersFunctioncreate_model
(lang, probs, oov_prob, vectors_data, vector_keys, expand_vectors, prune_vectors)
scripts/init_model.py:106
↓ 1 callersFunctionmerge_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 callersFunctionmost_similar
(word)
examples/vectors.py:10
↓ 1 callersFunctionopen_file
Handle .gz, .tar.gz or unzipped files
scripts/init_model.py:90
↓ 1 callersFunctionparallelize
(func, iterator, n_jobs)
scripts/word_freqs.py:52
↓ 1 callersFunctionprocess_request
examples/blackstream.py:12
↓ 1 callersFunctionprocess_text
(text)
examples/blackstream.py:24
↓ 1 callersFunctionread_freqs
(freqs_loc, max_length=100, min_doc_freq=5, min_freq=50)
scripts/init_model.py:168
↓ 1 callersFunctionread_vectors
(vectors_loc)
scripts/init_model.py:151
↓ 1 callersFunctionshort_form_filter
(span: Span)
blackstone/pipeline/abbreviations.py:144
↓ 1 callersMethodsum_iterable
(self, i)
tests/test_sentence_segmenter.py:20
↓ 1 callersFunctiontoken_in_match_range
(token, matches)
blackstone/pipeline/sentence_segmenter.py:88
↓ 1 callersFunctiontrim_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 callersFunctiontrim_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
Functioncount_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
Functionget_sort_key
(span: Span)
blackstone/utils/legislation_linker.py:32
Functioninit_model
Create a new model from raw data, like word frequencies, Brown clusters and word vectors.
scripts/init_model.py:54
Functionmain
Load the model, set up the pipeline and train the entity recognizer.
scripts/train_ner.py:63
Functionmain
(sent_loc: Path, output_dir: Path)
scripts/train_vectors.py:37
Functionmain
(raw_dir: Path, output_dir: Path, n_jobs=2)
scripts/word_freqs.py:77
Functionmain
Load the model, set up the pipeline and train the entity recognizer.
scripts/simple_training.py:56
Functionmain
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
MethodsetUp
(self)
tests/test_sentence_segmenter.py:8
MethodsetUp
(self)
tests/test_legislation_linker.py:23
MethodsetUp
(self)
tests/test_abbreviation.py:13
Methodtest_citation
(self)
tests/test_sentence_segmenter.py:14
Methodtest_containsQuotes
(self)
tests/test_abbreviation.py:21
Methodtest_extract_legislation_relations
(self)
tests/test_legislation_linker.py:68
Methodtest_filter_matches
(self)
tests/test_abbreviation.py:99
Methodtest_filter_spans
(self)
tests/test_legislation_linker.py:28
Methodtest_find
(self)
tests/test_abbreviation.py:116
Methodtest_find_abbreviation
(self)
tests/test_abbreviation.py:63
Methodtest_set_legislation_target
(self)
tests/test_legislation_linker.py:43
Methodtest_set_provision_target
(self)
tests/test_legislation_linker.py:55