Skip to content

Commit

Permalink
Merge branch 'master' into gh-3243/add_pickle_support
Browse files Browse the repository at this point in the history
  • Loading branch information
helpmefindaname committed Oct 23, 2023
2 parents 22cd5c3 + cbe750f commit 7021c2e
Show file tree
Hide file tree
Showing 146 changed files with 5,225 additions and 2,025 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ jobs:
FLAIR_CACHE_ROOT: ./cache/flair
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python 3.8
id: setup-python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
- name: Install Torch cpu
run: pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Install Flair dependencies
run: pip install -e .
- name: Install unittest dependencies
Expand All @@ -31,4 +33,4 @@ jobs:
- name: Run tests
run: |
python -c 'import flair'
pytest --runintegration --durations=0 -vv
pytest --runintegration -vv
11 changes: 11 additions & 0 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on: issue_comment

jobs:
issue_commented:
name: Issue comment
if: ${{ github.event.issue.pull_request && github.event.issue.author == github.even.issue_comment.author }}
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: "Awaiting Response"
45 changes: 45 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'Build doc page'
on:
push:
branches: [ master ]
tags:
- "*"

jobs:
publish_docs:
name: Build the docs using Sphinx and push to gh-pages
runs-on: ubuntu-latest
env:
python-version: 3.8
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: setup python ${{ env.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
- name: Install Torch cpu
run: pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Install Flair dependencies
run: pip install -e .
- name: Install unittest dependencies
run: pip install -r requirements-dev.txt
- name: Install doc dependencies
run: pip install -r docs/requirements.txt
- name: Fetch git tags
run: git fetch --tags origin
- name: Build docs
run: |
sphinx-multiversion docs doc_build/
- name: Add redirect to stable doc
run: |
cp assets/redirect.html doc_build/index.html
cp assets/redirect.html doc_build/404.html
cp assets/README.md doc_build/README.md
sed -i "s/\[VERSION\]/$(python -c 'import flair;print(flair.__version__)')/g" doc_build/index.html
sed -i "s/\[VERSION\]/$(python -c 'import flair;print(flair.__version__)')/g" doc_build/404.html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc_build
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ the code should hopefully be easy.

### Setup

Flair requires python-3.7 or higher. To make sure your code also runs on the oldest supported
python version, it is recommended to use python-3.7.x for flair development.
Flair requires python-3.8 or higher. To make sure your code also runs on the oldest supported
python version, it is recommended to use python-3.8.x for flair development.

Create a python environment of your preference and run:
```bash
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Flair ships with state-of-the-art models for a range of NLP tasks. For instance,
| Spanish | Conll-03 (4-class) | **90.54** | *90.3 [(Yu et al., 2020)](https://www.aclweb.org/anthology/2020.acl-main.577.pdf)* | [Flair Spanish 4-class NER demo](https://huggingface.co/flair/ner-spanish-large) |

Many Flair sequence tagging models (named entity recognition, part-of-speech tagging etc.) are also hosted
on the [__🤗 HuggingFace model hub__](https://huggingface.co/models?library=flair&sort=downloads)! You can browse models, check detailed information on how they were trained, and even try each model out online!
on the [__🤗 Hugging Face model hub__](https://huggingface.co/models?library=flair&sort=downloads)! You can browse models, check detailed information on how they were trained, and even try each model out online!


## Quick Start
Expand All @@ -52,7 +52,7 @@ In your favorite virtual environment, simply do:
pip install flair
```

Flair requires Python 3.7+.
Flair requires Python 3.8+.

### Example 1: Tag Entities in Text

Expand Down
6 changes: 6 additions & 0 deletions assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Docs For Flair NLP

This branch is currently under construction.

It will contain the docs for Flair NLP.
Don't change files, as this branch will be autogenerated using github actions.
9 changes: 9 additions & 0 deletions assets/redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Redirecting to https://flairnlp.github.io/</title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; URL=https://flairnlp.github.io/">
<link rel="canonical" href="https://flairnlp.github.io/">
</head>
</html>
2 changes: 2 additions & 0 deletions docs/_static/api.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/_static/contributing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/favicon.ico
Binary file not shown.
8 changes: 8 additions & 0 deletions docs/_static/glossary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions docs/_static/tutorial.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions docs/_templates/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% extends "!page.html" %}
{% block body %}
{% if current_version and latest_version and current_version != latest_version and current_version != release and current_version.name != latest_version.release %}
<p>
<strong>
{% if current_version.is_released %}
{% if latest_version.release.replace('v', '').split('.') | map('int') | list > current_version.name.replace('v', '').split('.') | map('int') | list %}
You're reading an old version of this documentation.
If you want up-to-date information, please have a look at <a href="{{ vpathto(latest_version.name) }}">{{latest_version.name}}</a>.
{% endif %}
{% else %}
You're reading the documentation for a development version.
For the latest stable version, please have a look at <a href="{{ vpathto(latest_version.name) }}">{{latest_version.name}}</a>.
{% endif %}
</strong>
</p>
{% endif %}
{{ super() }}
{% endblock %}%
30 changes: 30 additions & 0 deletions docs/_templates/version-switcher.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{# As the version switcher will only work when JavaScript is enabled, we add it through JavaScript.
#}
<script>
document.write(`
<div class="version-switcher__container dropdown">
<button id="versionswitcherbutton" type="button" role="button" class="version-switcher__button btn btn-sm navbar-btn dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="listbox" aria-controls="versionswitcherlist" aria-label="Version switcher list">
{% if current_version.is_released %} {{ current_version.name }} {% if latest_version and item == latest_version %} (stable) {% endif %} {% else %} latest (dev) {% endif %}
<span class="caret"></span>
</button>
<div id="versionswitcherlist" class="version-switcher__menu dropdown-menu list-group-flush py-0" role="listbox" aria-labelledby="versionswitcherbutton">
<!-- dropdown will be populated by javascript on page load -->
{%- for item in versions|reverse %}
<a class="list-group-item list-group-item-action py-1" href="{{ item.url }}" data-version-name="dev" data-version="devdocs">
<span>{% if item.is_released %}
{{ item.name }}
{% if latest_version and item == latest_version %}
(stable)
{% endif %}
{% else %}
latest (dev)
{% endif %}
{% if item == current_version %}
[x]
{% endif %}</span>
</a>
{%- endfor %}
</div>
</div>
`);
</script>
17 changes: 17 additions & 0 deletions docs/_templates/versioning.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% if versions %}
<h3>{{ _('Versions') }}</h3>
<ul>
{%- for item in versions|reverse %}
<li><a href="{{ item.url }}">
{% if item.is_released %}
{{ item.name }}
{% if latest_version and item == latest_version %}
(stable)
{% endif %}
{% else %}
latest ({{ item.name }})
{% endif %}
</a></li>
{%- endfor %}
</ul>
{% endif %}
4 changes: 4 additions & 0 deletions docs/api/datasets/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.base
===================

.. automodule:: flair.datasets.base
4 changes: 4 additions & 0 deletions docs/api/datasets/biomedical.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.biomedical
=========================

.. automodule:: flair.datasets.biomedical
4 changes: 4 additions & 0 deletions docs/api/datasets/document_classification.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.document_classification
======================================

.. automodule:: flair.datasets.document_classification
4 changes: 4 additions & 0 deletions docs/api/datasets/entity_linking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.entity_linking
=============================

.. automodule:: flair.datasets.entity_linking
4 changes: 4 additions & 0 deletions docs/api/datasets/ocr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.ocr
==================

.. automodule:: flair.datasets.ocr
4 changes: 4 additions & 0 deletions docs/api/datasets/relation_extraction.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.relation_extraction
==================================

.. automodule:: flair.datasets.relation_extraction
4 changes: 4 additions & 0 deletions docs/api/datasets/sequence_labeling.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.sequence_labeling
================================

.. automodule:: flair.datasets.sequence_labeling
4 changes: 4 additions & 0 deletions docs/api/datasets/text_image.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.text_image
=========================

.. automodule:: flair.datasets.text_image
4 changes: 4 additions & 0 deletions docs/api/datasets/text_text.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.text_text
=========================

.. automodule:: flair.datasets.text_text
4 changes: 4 additions & 0 deletions docs/api/datasets/treebanks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.treebanks
========================

.. automodule:: flair.datasets.treebanks
4 changes: 4 additions & 0 deletions docs/api/embeddings/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.embeddings.base
=====================

.. automodule:: flair.embeddings.base
4 changes: 4 additions & 0 deletions docs/api/embeddings/document.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.embeddings.document
=========================

.. automodule:: flair.embeddings.document
4 changes: 4 additions & 0 deletions docs/api/embeddings/image.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.embeddings.image
======================

.. automodule:: flair.embeddings.image
8 changes: 8 additions & 0 deletions docs/api/embeddings/legacy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
flair.embeddings.legacy
============================

.. warning::
All embeddings in `flair.embeddings.legacy` are considered deprecated.
there is no guarantee that they are still working and we recommend using different embeddings instead.

.. automodule:: flair.embeddings.legacy
4 changes: 4 additions & 0 deletions docs/api/embeddings/token.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.embeddings.token
======================

.. automodule:: flair.embeddings.token
4 changes: 4 additions & 0 deletions docs/api/embeddings/transformer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.embeddings.transformer
============================

.. automodule:: flair.embeddings.transformer
4 changes: 4 additions & 0 deletions docs/api/flair.data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.data
==========

.. automodule:: flair.data
8 changes: 8 additions & 0 deletions docs/api/flair.datasets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
flair.datasets
==============

.. toctree::
:glob:
:maxdepth: 2

datasets/*
8 changes: 8 additions & 0 deletions docs/api/flair.embeddings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
flair.embeddings
================

.. toctree::
:glob:
:maxdepth: 2

embeddings/*
Loading

0 comments on commit 7021c2e

Please sign in to comment.