Extract city and country mentions from Text like GeoText without regex, but FlashText, a Aho-Corasick implementation.

Overview

Build Status Coverage


flashgeotext 🌍

Extract and count countries and cities (+their synonyms) from text, like GeoText on steroids using FlashText, a Aho-Corasick implementation. Flashgeotext is a fast, batteries-included (and BYOD) and native python library that extracts one or more sets of given city and country names (+ synonyms) from an input text.

documentation: https://flashgeotext.iwpnd.pw/
introductory blogpost: https://iwpnd.pw/articles/2020-02/flashgeotext-library

Usage

from flashgeotext.geotext import GeoText

geotext = GeoText()

input_text = '''Shanghai. The Chinese Ministry of Finance in Shanghai said that China plans
                to cut tariffs on $75 billion worth of goods that the country
                imports from the US. Washington welcomes the decision.'''

geotext.extract(input_text=input_text)
>> {
    'cities': {
        'Shanghai': {
            'count': 2,
            'span_info': [(0, 8), (45, 53)],
            'found_as': ['Shanghai', 'Shanghai'],
            },
        'Washington, D.C.': {
            'count': 1,
            'span_info': [(175, 185)],
            'found_as': ['Washington'],
            }
        },
    'countries': {
        'China': {
            'count': 1,
            'span_info': [(64, 69)],
            'found_as': ['China'],
            },
        'United States': {
            'count': 1,
            'span_info': [(171, 173)],
            'found_as': ['US'],
            }
        }
    }

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

pip:

pip install flashgeotext

conda:

conda install flashgeotext

for development:

git clone https://github.com/iwpnd/flashgeotext.git
cd flashgeotext/
poetry install

Running the tests

poetry run pytest . -v

Authors

  • Benjamin Ramser - Initial work - iwpnd

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Demo Data cities from http://www.geonames.org licensed under the Creative Commons Attribution 3.0 License.

Acknowledgments

Comments
  • Cannot install 0.3.0 or 0.3.1

    Cannot install 0.3.0 or 0.3.1

    Hi:

    I try to install flashgeotext 0.3.1 via pip or pipenv but i get the following error:

    COMAND: pipenv iinstall flashgeotext~=0.3.0

    ERROR: ERROR: Could not find a version that satisfies the requirement flashgeotext~=0.3.0 ERROR: No matching distribution found for flashgeotext~=0.3.0

    How can i solve it?

    Thanks in advance. Best.

    opened by LuciaTajuelo 6
  • Publishing package on conda-forge

    Publishing package on conda-forge

    Hi @iwpnd, this is a great package! Unfortunately, it is not available on conda-forge while flashtext can be found. I'm building a library around it and I can only fetch packages from conda-forge so I'm wondering if you might accept PR to publish on conda-forge eventually. For now the workaround is to embed all flashgeotext as a module statically but I would love to declare it in the dependencies.

    opened by francbartoli 6
  • seem debugging will cause some fatal errors

    seem debugging will cause some fatal errors

    image Hello, your method helps me a lot, and I just wanna debug at some point, but much to my suprise, it will show some fatal errors once debug, how can we solve this probelm image image

    opened by BriskyGates 5
  • Missing cities and countries

    Missing cities and countries

    Hello,

    I have started trying out this library, but it seems to be missing cities and countries mostly from South America. What's the best way to update the cities.json and countries.json files? Is it ok just to add the data in there manually?

    Also, how can this library map Shanghai as China, where is that relation mapped? why does it not behave the same for Caracas?

    >>> geotext.extract(input_text="Living in Caracas", span_info=True)
    {'cities': {'Caracas': {'count': 1, 'span_info': [(10, 17)]}}, 'countries': {}}
    

    Thanks in advance!

    enhancement 
    opened by pythobot 5
  • chore(deps-dev): bump awscli from 1.25.67 to 1.25.68

    chore(deps-dev): bump awscli from 1.25.67 to 1.25.68

    Bumps awscli from 1.25.67 to 1.25.68.

    Changelog

    Sourced from awscli's changelog.

    1.25.68

    • api-change:identitystore: Documentation updates for the Identity Store CLI Reference.
    • api-change:sagemaker: This release adds HyperParameterTuningJob type in Search API.
    Commits
    • 5df5380 Merge branch 'release-1.25.68'
    • 5a9ece8 Bumping version to 1.25.68
    • 2d83b15 Update changelog based on model updates
    • aa1b1b1 Merge branch 'release-1.25.67' into develop
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 3
  • TypeError: slice indices must be integers or None or have an __index__ method when span_info is False

    TypeError: slice indices must be integers or None or have an __index__ method when span_info is False

    As per the doc https://flashgeotext.iwpnd.pw/geotext/, the GeoText Class python function extract has an optional argument span_info : bool - return span_info. Defaults to True. However, on passing the span_info argument as false, GeoText fails to parse the text and throws an index slice error.

    Below are the steps to reproduce the error:

    from flashgeotext.geotext import GeoText
    geotext2 = GeoText()
    
    input_text = '''Shanghai. The Chinese Ministry of Finance in Shanghai said that China plans
                        to cut tariffs on $75 billion worth of goods that the country
                        imports from the US. Washington welcomes the decision.'''
    
    geotext2.extract(input_text=input_text, span_info=False)
    

    Output: > "found_as": [input_text[span_start:span_end]], TypeError: slice indices must be integers or None or have an index method

    bug 
    opened by shreyjakhmolacactus 3
  • Initial impressions and questions of flashgeotext for extracting countries from affiliations

    Initial impressions and questions of flashgeotext for extracting countries from affiliations

    Thanks for posting at https://github.com/elyase/geotext/issues/23#issuecomment-593490351 letting me know about this package. I'm interested in it as a way to extract countries referred to in author affiliations.

    For example, here is an affiliation:

    'Multimodal Computing and Interaction', Saarland University & Department for Computational Biology and Applied Computing, Max Planck Institute for Informatics, Saarbrücken, 66123 Saarland, Germany, Ray and Stephanie Lane Center for Computational Biology, Carnegie Mellon University, Pittsburgh, 15206 PA, USA, Department of Mathematics and Computer Science, Freie Universität Berlin, 14195 Berlin, Germany, Université Pierre et Marie Curie, UMR7238, CNRS-UPMC, Paris, France and CNRS, UMR7238, Laboratory of Computational and Quantitative Biology, Paris, France.

    For my project, I'd like to know what countries are mentioned (either directly or inferred from a place mention inside that country).

    If I run the following (with v0.2.0):

    import flashgeotext.geotext
    geotexter = flashgeotext.geotext.GeoText(use_demo_data=True)
    affil = """\
    'Multimodal Computing and Interaction', Saarland University & Department for Computational Biology and Applied Computing, Max Planck Institute for Informatics, Saarbrücken, 66123 Saarland, Germany, \
    Ray and Stephanie Lane Center for Computational Biology, Carnegie Mellon University, Pittsburgh, 15206 PA, USA, \
    Department of Mathematics and Computer Science, Freie Universität Berlin, 14195 Berlin, Germany, Université Pierre et Marie Curie, UMR7238, CNRS-UPMC, Paris, France and CNRS, UMR7238, Laboratory of Computational and Quantitative Biology, Paris, France.
    """
    geo_text = geotexter.extract(affil, span_info=False)
    geo_text
    

    I get the following output:

    2020-03-02 18:50:46.475 | DEBUG    | flashgeotext.lookup:add:194 - cities added to pool
    2020-03-02 18:50:46.479 | DEBUG    | flashgeotext.lookup:add:194 - countries added to pool
    2020-03-02 18:50:46.480 | DEBUG    | flashgeotext.lookup:_add_demo_data:225 - demo data loaded for: ['cities', 'countries']
    {'cities': {'University': {'count': 2},
      'Saarbrücken': {'count': 1},
      'Carnegie': {'count': 1},
      'Pittsburgh': {'count': 1},
      'Berlin': {'count': 2},
      'Parys': {'count': 2}},
     'countries': {'Germany': {'count': 2},
      'United States': {'count': 1},
      'France': {'count': 2}}}
    

    Some impressions / questions?

    1. Are the city mentions counting towards country mentions? If yes, why does "United States" not have a count of 2 for "Pittsburgh" and "USA".

    2. Is "Parys" for "Paris"... not sure why this conversion is made.

    3. Counting "University" as a city will almost always be a false positive for us, although I'm guessing this is a source data issue.

    Thanks for considering this feedback / helping answer any of these questions.

    bug question 
    opened by dhimmel 3
  • chore(deps-dev): bump markdown-include from 0.7.0 to 0.8.0

    chore(deps-dev): bump markdown-include from 0.7.0 to 0.8.0

    Bumps markdown-include from 0.7.0 to 0.8.0.

    Release notes

    Sourced from markdown-include's releases.

    v0.8.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/cmacmackin/markdown-include/compare/v0.7.2...v0.8.0

    v0.7.2

    Project CI fix only

    Full Changelog: https://github.com/cmacmackin/markdown-include/compare/v0.7.1...v0.7.2

    v0.7.1

    What's Changed

    New Contributors

    Full Changelog: https://github.com/cmacmackin/markdown-include/compare/v0.7.0...v0.7.1

    Commits
    • fd3c00a Merge pull request #40 from cmacmackin/apply-black
    • 490d3cd CI: Automate black
    • 7bf110f Add git blame ignore file
    • b7b87a7 Apply black formatting
    • 993e858 Merge pull request #39 from cmacmackin/lines-and-line-ranges
    • f5e754d Add tests for including lines
    • 03c4ea0 Merge branch 'master' into lines-and-line-ranges
    • 692e499 Merge pull request #38 from cmacmackin/unittests-ci
    • 40109fb Delete outdated README.rst file
    • 6ae487c CI: Run tests
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 2
  • chore(deps-dev): bump awscli from 1.27.13 to 1.27.17

    chore(deps-dev): bump awscli from 1.27.13 to 1.27.17

    Bumps awscli from 1.27.13 to 1.27.17.

    Changelog

    Sourced from awscli's changelog.

    1.27.17

    • api-change:backup: AWS Backup introduces support for legal hold and application stack backups. AWS Backup Audit Manager introduces support for cross-Region, cross-account reports.
    • api-change:cloudwatch: Update cloudwatch command to latest version
    • api-change:drs: Non breaking changes to existing APIs, and additional APIs added to support in-AWS failing back using AWS Elastic Disaster Recovery.
    • api-change:ecs: This release adds support for ECS Service Connect, a new capability that simplifies writing and operating resilient distributed applications. This release updates the TaskDefinition, Cluster, Service mutation APIs with Service connect constructs and also adds a new ListServicesByNamespace API.
    • api-change:efs: Update efs command to latest version
    • api-change:iot-data: This release adds support for MQTT5 properties to AWS IoT HTTP Publish API.
    • api-change:iot: Job scheduling enables the scheduled rollout of a Job with start and end times and a customizable end behavior when end time is reached. This is available for continuous and snapshot jobs. Added support for MQTT5 properties to AWS IoT TopicRule Republish Action.
    • api-change:iotwireless: This release includes a new feature for customers to calculate the position of their devices by adding three new APIs: UpdateResourcePosition, GetResourcePosition, and GetPositionEstimate.
    • api-change:kendra: Amazon Kendra now supports preview of table information from HTML tables in the search results. The most relevant cells with their corresponding rows, columns are displayed as a preview in the search result. The most relevant table cell or cells are also highlighted in table preview.
    • api-change:logs: Updates to support CloudWatch Logs data protection and CloudWatch cross-account observability
    • api-change:mgn: This release adds support for Application and Wave management. We also now support custom post-launch actions.
    • api-change:oam: Amazon CloudWatch Observability Access Manager is a new service that allows configuration of the CloudWatch cross-account observability feature.
    • api-change:organizations: This release introduces delegated administrator for AWS Organizations, a new feature to help you delegate the management of your Organizations policies, enabling you to govern your AWS organization in a decentralized way. You can now allow member accounts to manage Organizations policies.
    • api-change:rds: This release enables new Aurora and RDS feature called Blue/Green Deployments that makes updates to databases safer, simpler and faster.
    • api-change:textract: This release adds support for classifying and splitting lending documents by type, and extracting information by using the Analyze Lending APIs. This release also includes support for summarized information of the processed lending document package, in addition to per document results.
    • api-change:transcribe: This release adds support for 'inputType' for post-call and real-time (streaming) Call Analytics within Amazon Transcribe.

    1.27.16

    • api-change:grafana: This release includes support for configuring a Grafana workspace to connect to a datasource within a VPC as well as new APIs for configuring Grafana settings.
    • api-change:rbin: This release adds support for Rule Lock for Recycle Bin, which allows you to lock retention rules so that they can no longer be modified or deleted.

    1.27.15

    • api-change:appflow: Adding support for Amazon AppFlow to transfer the data to Amazon Redshift databases through Amazon Redshift Data API service. This feature will support the Redshift destination connector on both public and private accessible Amazon Redshift Clusters and Amazon Redshift Serverless.
    • api-change:kinesisanalyticsv2: Support for Apache Flink 1.15 in Kinesis Data Analytics.

    1.27.14

    • api-change:route53: Amazon Route 53 now supports the Asia Pacific (Hyderabad) Region (ap-south-2) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region.
    Commits
    • 4c3c2f3 Merge branch 'release-1.27.17'
    • 068265f Bumping version to 1.27.17
    • bb73db9 Update changelog based on model updates
    • 99f1f30 Merge branch 'release-1.27.16'
    • 11eab4e Merge branch 'release-1.27.16' into develop
    • e6b2e68 Bumping version to 1.27.16
    • 0d18491 Update changelog based on model updates
    • 1b0005a Merge branch 'release-1.27.15' into develop
    • 140ef2e Merge branch 'release-1.27.15'
    • f963121 Bumping version to 1.27.15
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 2
  • chore(deps-dev): bump poethepoet from 0.16.4 to 0.16.5

    chore(deps-dev): bump poethepoet from 0.16.4 to 0.16.5

    Bumps poethepoet from 0.16.4 to 0.16.5.

    Release notes

    Sourced from poethepoet's releases.

    v0.16.5

    Fixes

    New Contributors

    Full Changelog: https://github.com/nat-n/poethepoet/compare/v0.16.4...v0.16.5

    Commits
    • d266433 Bump version to 0.16.5
    • 15edd33 Fix issues on windows and restore changes from 0.16.1 (#106)
    • e41072c Fix typo in --help output (#105)
    • 1a6973a Add isort (#102)
    • f730b26 Add python 3.11 to the CI and update 'dev-dependencies' to 'group.dev.depende...
    • 53083b5 Only use tomli in python<3.11 (#100)
    • 6924b81 docs: use poetry add --group dev instead of poetry add --dev (#98)
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 2
  • chore(deps): bump codecov/codecov-action from 3.1.0 to 3.1.1

    chore(deps): bump codecov/codecov-action from 3.1.0 to 3.1.1

    Bumps codecov/codecov-action from 3.1.0 to 3.1.1.

    Release notes

    Sourced from codecov/codecov-action's releases.

    3.1.1

    What's Changed

    New Contributors

    Full Changelog: https://github.com/codecov/codecov-action/compare/v3.1.0...v3.1.1

    Changelog

    Sourced from codecov/codecov-action's changelog.

    3.1.1

    Fixes

    • #661 Update deprecation warning
    • #593 Create codeql-analysis.yml
    • #712 README: fix typo
    • #725 fix: Remove a blank row
    • #726 Update README.md with correct badge version
    • #633 Create scorecards-analysis.yml
    • #747 fix: add more verbosity to validation
    • #750 Regenerate scorecards-analysis.yml
    • #774 Switch to v3
    • #783 Fix network entry in table
    • #791 Trim arguments after splitting them
    • #769 Plumb failCi into verification function.

    Dependencies

    • #713 build(deps-dev): bump typescript from 4.6.3 to 4.6.4
    • #714 build(deps): bump node-fetch from 3.2.3 to 3.2.4
    • #724 build(deps): bump github/codeql-action from 1 to 2
    • #717 build(deps-dev): bump @​types/jest from 27.4.1 to 27.5.0
    • #729 build(deps-dev): bump @​types/node from 17.0.25 to 17.0.33
    • #734 build(deps-dev): downgrade @​types/node to 16.11.35
    • #723 build(deps): bump actions/checkout from 2 to 3
    • #733 build(deps): bump @​actions/github from 5.0.1 to 5.0.3
    • #732 build(deps): bump @​actions/core from 1.6.0 to 1.8.2
    • #737 build(deps-dev): bump @​types/node from 16.11.35 to 16.11.36
    • #749 build(deps): bump ossf/scorecard-action from 1.0.1 to 1.1.0
    • #755 build(deps-dev): bump typescript from 4.6.4 to 4.7.3
    • #759 build(deps-dev): bump @​types/node from 16.11.36 to 16.11.39
    • #762 build(deps-dev): bump @​types/node from 16.11.39 to 16.11.40
    • #746 build(deps-dev): bump @​vercel/ncc from 0.33.4 to 0.34.0
    • #757 build(deps): bump ossf/scorecard-action from 1.1.0 to 1.1.1
    • #760 build(deps): bump openpgp from 5.2.1 to 5.3.0
    • #748 build(deps): bump actions/upload-artifact from 2.3.1 to 3.1.0
    • #766 build(deps-dev): bump typescript from 4.7.3 to 4.7.4
    • #799 build(deps): bump openpgp from 5.3.0 to 5.4.0
    • #798 build(deps): bump @​actions/core from 1.8.2 to 1.9.1
    Commits
    • d9f34f8 release: update changelog and version to 3.1.1 (#828)
    • 0e9e7b4 Plumb failCi into verification function. (#769)
    • 7f20bd4 build(deps): bump @​actions/core from 1.8.2 to 1.9.1 (#798)
    • 13bc253 build(deps): bump openpgp from 5.3.0 to 5.4.0 (#799)
    • 5c0da1b Trim arguments after splitting them (#791)
    • 68d5f6d Fix network entry in table (#783)
    • 2a829b9 Switch to v3 (#774)
    • 8e09eaf build(deps-dev): bump typescript from 4.7.3 to 4.7.4 (#766)
    • 39e2229 build(deps): bump actions/upload-artifact from 2.3.1 to 3.1.0 (#748)
    • b2b7703 build(deps): bump openpgp from 5.2.1 to 5.3.0 (#760)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 2
  • chore(deps): bump actions/cache from 3.2.2 to 3.2.3

    chore(deps): bump actions/cache from 3.2.2 to 3.2.3

    Bumps actions/cache from 3.2.2 to 3.2.3.

    Release notes

    Sourced from actions/cache's releases.

    v3.2.3

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/cache/compare/v3...v3.2.3

    Changelog

    Sourced from actions/cache's changelog.

    3.2.2

    • Reverted the changes made in 3.2.1 to use gnu tar and zstd by default on windows.

    3.2.3

    • Support cross os caching on Windows as an opt-in feature.
    • Fix issue with symlink restoration on Windows for cross-os caches.
    Commits
    • 58c146c Release support for cross-os caching as opt-in feature (#1060)
    • 6fd2d45 Add support to opt-in enable cross-os caching on windows (#1056)
    • 1f41429 Fixed broken link (#1057)
    • 365406c Merge pull request #1051 from uhooi/feature/add_mint_example
    • d621756 Update Mint example
    • 84e5400 Merge remote-tracking branch 'origin/main' into feature/add_mint_example
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
Releases(v0.4.2)
  • v0.4.2(Feb 1, 2022)

  • v0.4.1(Jan 31, 2022)

  • v0.4.0(Sep 13, 2021)

    Summary

    • removed the option to show the span_info and made it a default instead.
    • Additionally .extract now returns under what word (or synonym) the keyword was found in the input text.
    • As the configuration was implemented a little doofy, I updated how the configuration can be passed on init of GeoText.

    Refactor

    Fix

    • Make configuration better (e57150f)
    from flashgeotext.geotext import GeoText, GeoTextConfiguration
    
    config = GeoTextConfiguration(**{"use_demo_data":True})
    geotext = GeoText()
    
    input_text = '''Shanghai. The Chinese Ministry of Finance in Shanghai said that China plans
                    to cut tariffs on $75 billion worth of goods that the country
                    imports from the US. Washington welcomes the decision.'''
    
    geotext.extract(input_text=input_text)
    >> {
        'cities': {
            'Shanghai': {
                'count': 2,
                'span_info': [(0, 8), (45, 53)],
                'found_as': ['Shanghai', 'Shanghai'],
                },
            'Washington, D.C.': {
                'count': 1,
                'span_info': [(175, 185)],
                'found_as': ['Washington'],
                }
            },
        'countries': {
            'China': {
                'count': 1,
                'span_info': [(64, 69)],
                'found_as': ['China'],
                },
            'United States': {
                'count': 1,
                'span_info': [(171, 173)],
                'found_as': ['US'],
                }
            }
        }
    
    Source code(tar.gz)
    Source code(zip)
  • v0.3.2(Apr 13, 2021)

    • Switching package management to Poetry I accidentally introduced Python 3.8 as minimum requirement. Reverting to Python 3.7 as minimum requirement.
    • Some housekeeping
    Source code(tar.gz)
    Source code(zip)
  • v0.3.1(Apr 7, 2021)

    Loglevel is now set to WARNING by default and can be changed using environment variables.

    For example:

    export LOGURU_LEVEL=DEBUG to enable debug logging.

    Allowed levels are ERROR, WARNING, DEBUG and INFO

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Feb 28, 2021)

    Following up on #20 You can now choose to allow to ignore the case of the lookup data.

    from flashgeotext.geotext import GeoText
    geotext = GeoText(config = { "use_demo_data": True, "case_sensitive": True })
    text = "berlin ist ne tolle stadt"
    geotext.extract(input_text=text, span_info=True)
    >> { "cities": { "Berlin": [(0,6)] } 
    
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Mar 2, 2020)

    [0.2.0] - 2020-03-02

    • added script argument to LookupData to specify from what script the characters in the lookup will be, see usage, this will make sure that flashgeotext works properly with different character sets (latin, cyrillic, thai etc)
    • demo-data will (for now) use default character set as non_word_boundary, see @issue-13
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Feb 25, 2020)

    Initial release of flashgeotext

    Extract and count countries and cities from text, like GeoText on steroids using FlashText, an Aho-Corasick implementation. Flashgeotext is a fast, batteries-included (and BYOD) and native python library that extracts one or more sets of given city and country names (+ synonyms) from an input text.

    see docs

    Source code(tar.gz)
    Source code(zip)
Owner
Ben
geographer turned spatial engineer turned data-something turned software developer
Ben
An Explainable Leaderboard for NLP

ExplainaBoard: An Explainable Leaderboard for NLP Introduction | Website | Download | Backend | Paper | Video | Bib Introduction ExplainaBoard is an i

NeuLab 319 Dec 20, 2022
Blue Brain text mining toolbox for semantic search and structured information extraction

Blue Brain Search Source Code DOI Data & Models DOI Documentation Latest Release Python Versions License Build Status Static Typing Code Style Securit

The Blue Brain Project 29 Dec 01, 2022
Natural language processing summarizer using 3 state of the art Transformer models: BERT, GPT2, and T5

NLP-Summarizer Natural language processing summarizer using 3 state of the art Transformer models: BERT, GPT2, and T5 This project aimed to provide in

Samuel Sharkey 1 Feb 07, 2022
Dé op-de-vlucht Pieton vertaler. Wereldwijd gebruikt door meer dan 1.000+ succesvolle bedrijven!

Dé op-de-vlucht Pieton vertaler. Wereldwijd gebruikt door meer dan 1.000+ succesvolle bedrijven!

Lau 1 Dec 17, 2021
Super Tickets in Pre-Trained Language Models: From Model Compression to Improving Generalization (ACL 2021)

Structured Super Lottery Tickets in BERT This repo contains our codes for the paper "Super Tickets in Pre-Trained Language Models: From Model Compress

Chen Liang 16 Dec 11, 2022
Repository for fine-tuning Transformers 🤗 based seq2seq speech models in JAX/Flax.

Seq2Seq Speech in JAX A JAX/Flax repository for combining a pre-trained speech encoder model (e.g. Wav2Vec2, HuBERT, WavLM) with a pre-trained text de

Sanchit Gandhi 21 Dec 14, 2022
Labelling platform for text using distant supervision

With DataQA, you can label unstructured text documents using rule-based distant supervision.

245 Aug 05, 2022
Python interface for converting Penn Treebank trees to Stanford Dependencies and Universal Depenencies

PyStanfordDependencies Python interface for converting Penn Treebank trees to Universal Dependencies and Stanford Dependencies. Example usage Start by

David McClosky 64 May 08, 2022
TFIDF-based QA system for AIO2 competition

AIO2 TF-IDF Baseline This is a very simple question answering system, which is developed as a lightweight baseline for AIO2 competition. In the traini

Masatoshi Suzuki 4 Feb 19, 2022
Code for the ACL 2021 paper "Structural Guidance for Transformer Language Models"

Structural Guidance for Transformer Language Models This repository accompanies the paper, Structural Guidance for Transformer Language Models, publis

International Business Machines 10 Dec 14, 2022
Summarization module based on KoBART

KoBART-summarization Install KoBART pip install git+https://github.com/SKT-AI/KoBART#egg=kobart Requirements pytorch==1.7.0 transformers==4.0.0 pytor

seujung hwan, Jung 148 Dec 28, 2022
Free and Open Source Machine Translation API. 100% self-hosted, offline capable and easy to setup.

LibreTranslate Try it online! | API Docs | Community Forum Free and Open Source Machine Translation API, entirely self-hosted. Unlike other APIs, it d

3.4k Dec 27, 2022
Anomaly Detection 이상치 탐지 전처리 모듈

Anomaly Detection 시계열 데이터에 대한 이상치 탐지 1. Kernel Density Estimation을 활용한 이상치 탐지 train_data_path와 test_data_path에 존재하는 시점 정보를 포함하고 있는 csv 형태의 train data와

CLUST-consortium 43 Nov 28, 2022
ACL'22: Structured Pruning Learns Compact and Accurate Models

☕ CoFiPruning: Structured Pruning Learns Compact and Accurate Models This repository contains the code and pruned models for our ACL'22 paper Structur

Princeton Natural Language Processing 130 Jan 04, 2023
A Structured Self-attentive Sentence Embedding

Structured Self-attentive sentence embeddings Implementation for the paper A Structured Self-Attentive Sentence Embedding, which was published in ICLR

Kaushal Shetty 488 Nov 28, 2022
Python library for processing Chinese text

SnowNLP: Simplified Chinese Text Processing SnowNLP是一个python写的类库,可以方便的处理中文文本内容,是受到了TextBlob的启发而写的,由于现在大部分的自然语言处理库基本都是针对英文的,于是写了一个方便处理中文的类库,并且和TextBlob

Rui Wang 6k Jan 02, 2023
StarGAN - Official PyTorch Implementation

StarGAN - Official PyTorch Implementation ***** New: StarGAN v2 is available at https://github.com/clovaai/stargan-v2 ***** This repository provides t

Yunjey Choi 5.1k Dec 30, 2022
Twitter Sentiment Analysis using #tag, words and username

Twitter Sentment Analysis Web App using #tag, words and username to fetch data finds Insides of data and Tells Sentiment of the perticular #tag, words or username.

Kumar Saksham 26 Dec 25, 2022
In this project, we compared Spanish BERT and Multilingual BERT in the Sentiment Analysis task.

Applying BERT Fine Tuning to Sentiment Classification on Amazon Reviews Abstract Sentiment analysis has made great progress in recent years, due to th

Alexander Leonardo Lique Lamas 5 Jan 03, 2022
Easy to start. Use deep nerual network to predict the sentiment of movie review.

Easy to start. Use deep nerual network to predict the sentiment of movie review. Various methods, word2vec, tf-idf and df to generate text vectors. Various models including lstm and cov1d. Achieve f1

1 Nov 19, 2021