Grobid

libwapiti.so 编译方法

1
2
3
4
5
git clone https://github.com/adsva/libwapiti
cd libwapiti
git clone https://github.com/Jekub/Wapiti
gcc -fPIC -c -std=c99 -W -Wall -O3 -I ./Wapiti/src -lm -lpthread ./Wapiti/src/*.c ./src/*.c
gcc -shared -Wl,--wrap,fatal,--wrap,pfatal,--wrap,warning,--wrap,info,-soname,libwapiti.so -o libwapiti.so -lc *.o

Codegeex

api key

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.surveyUrlEN = exports.surveyUrlCN = exports.statApiHerf = exports.testSecret = exports.testKey = exports.testHref = exports.apiSecret = exports.apiKey = exports.apiHref = void 0;
// //tianqi api config
exports.apiHref = "https://tianqi.aminer.cn/api/v2";
exports.apiKey = "68cf004321e94b47a91c2e45a8109852";
exports.apiSecret = "e82b86a16f9d471ab215f653060310e3";
//wudao api config
// export const apiHref ='https://wudao.aminer.cn/os/api/api/v2';
// export const apiKey = 'f30ea902c3824ee88e221a32363c0823';
// export const apiSecret = '90664fc066434fac8983d309c758cd4d';
exports.testHref = 'https://wudao.aminer.cn/os/api/api/v2';
exports.testKey = 'f30ea902c3824ee88e221a32363c0823';
exports.testSecret = '90664fc066434fac8983d309c758cd4d';
//data statistics api
exports.statApiHerf = "https://maas.aminer.cn"; //process.env.NODE_ENV==='development'?'http://10.50.74.216:32621':'https://maas.aminer.cn';
exports.surveyUrlCN = "https://wj.qq.com/s2/11259178/fd49/";
exports.surveyUrlEN = "https://wj.qq.com/s2/11260705/6cd6/";
//# sourceMappingURL=localconfig.js.map
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
  "message": "success",
  "result": {
    "app": "multilingual_code_generate",
    "created_at": "Fri, 17 Mar 2023 06:18:52 GMT",
    "input": {
      "lang": "Python",
      "n": 3,
      "stop": [],
      "text": "# language: Python\nfrom typing import List\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n    \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n    given threshold.\n    >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n    False\n    >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n    True\n    \"\"\"\n"
    },
    "output": {
      "code": [
        "    for i in range(len(numbers) - 1):\n"
      ],
      "code_dict": [
        {
          "context": "# language: Python\nfrom typing import List\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n    \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n    given threshold.\n    >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n    False\n    >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n    True\n    \"\"\"\n",
          "cum_log_probs": -0.7978824377059937,
          "generated": "    for i in range(len(numbers) - 1):\n"
        }
      ],
      "completion_token_num": 32,
      "errcode": 0,
      "prompt_token_num": 132
    },
    "process_time": 0.8907933235168457,
    "task_id": "6414064ce016d96e7c58780e",
    "updated_at": "Fri, 17 Mar 2023 06:18:52 GMT",
    "user": {
      "appId": "6fd2a2a76f0a4015af45ef30f8c1436f",
      "id": "631ed7b83676d9dea55bcecd",
      "name": "游客459664"
    }
  },
  "status": 0
}

git ignore file

python

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Byte-compiled / optimized / DLL files
__pycache__/
,*.py[cod]
,*$py.class

# C extensions
,*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
,*.egg-info/
.installed.cfg
,*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
,*.manifest
,*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
,*.cover
,*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
,*.mo
,*.pot

# Django stuff:
,*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
#   For a library or package, you might want to ignore these files since the code is
#   intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# poetry
#   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
#   This is especially recommended for binary packages to ensure reproducibility, and is more
#   commonly ignored for libraries.
#   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
#   Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
#   pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
#   in version control.
#   https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
,*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
#  JetBrains specific template is maintained in a separate JetBrains.gitignore that can
#  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
#  and can be added to the global gitignore or merged into this file.  For a more nuclear
#  option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
.vscode
.dir-locals.el
.pdm-build
.pdm-python

# temp files
,*.log
,*~
\#*
pyenc.build

Pytest in Emacs

后台使用项目检测工具

  • projectile

提示 generic 类型项目

问题描述:

运行python-pytest-function-dwim 命令后跳出错误提示:

projectile--test-name-for-impl-name: Cannot determine a test file
name, one of "test-suffix" or "test-prefix" must be set for project
type ‘generic’

原因分析: