You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to train the classifier yourself, you will need the dependencies for the classifier (see installation).
168
173
169
174
Use `quantulum3-training` on the command line, the script `quantulum3/scripts/train.py` or the method `train_classifier` in `quantulum3.classifier` to train the classifier.
and [Magnitude](https://github.com/plasticityai/magnitude) for more information.
185
203
204
+
### Additional units
186
205
187
-
To use your custom model, pass the path to the trained model file to the
188
-
parser:
206
+
It is possible to add additional entities and units to be parsed by quantulum. These will be added to the default units and entities. See below code for an example invocation:
It is possible to load a completely custom set of units and entities. This can be done by passing a list of file paths to the load_custom_units and load_custom_entities functions. Loading custom untis and entities will replace the default units and entities that are normally loaded.
207
221
208
-
Quantulum classes include methods to convert them to a speakable unit.
222
+
The recomended way to load quantities is via a context manager:
It\'s easy to extend these two files to the units/entities of interest.
@@ -251,9 +269,9 @@ Here is an example of an entry in *entities.json*:
251
269
}
252
270
```
253
271
254
-
-The *name* of an entity is its key. Names are required to be unique.
255
-
-*URI* is the name of the wikipedia page of the entity. (i.e. `https://en.wikipedia.org/wiki/Speed` => `Speed`)
256
-
-*dimensions* is the dimensionality, a list of dictionaries each
272
+
- The *name* of an entity is its key. Names are required to be unique.
273
+
-*URI* is the name of the wikipedia page of the entity. (i.e. `https://en.wikipedia.org/wiki/Speed` => `Speed`)
274
+
-*dimensions* is the dimensionality, a list of dictionaries each
257
275
having a *base* (the name of another entity) and a *power* (an
258
276
integer, can be negative).
259
277
@@ -277,24 +295,24 @@ Here is an example of an entry in *units.json*:
277
295
}
278
296
```
279
297
280
-
-The *name* of a unit is its key. Names are required to be unique.
281
-
-*URI* follows the same scheme as in the *entities.json*
282
-
-*surfaces* is a list of strings that refer to that unit. The library
298
+
- The *name* of a unit is its key. Names are required to be unique.
299
+
-*URI* follows the same scheme as in the *entities.json*
300
+
-*surfaces* is a list of strings that refer to that unit. The library
283
301
takes care of plurals, no need to specify them.
284
-
-*entity* is the name of an entity in *entities.json*
285
-
-*dimensions* follows the same schema as in *entities.json*, but the
302
+
-*entity* is the name of an entity in *entities.json*
303
+
-*dimensions* follows the same schema as in *entities.json*, but the
286
304
*base* is the name of another unit, not of another entity.
287
-
-*symbols* is a list of possible symbols and abbreviations for that
305
+
-*symbols* is a list of possible symbols and abbreviations for that
288
306
unit.
289
-
-*prefixes* is an optional list. It can contain [Metric](https://en.wikipedia.org/wiki/Metric_prefix) and [Binary prefixes](https://en.wikipedia.org/wiki/Binary_prefix) and
307
+
-*prefixes* is an optional list. It can contain [Metric](https://en.wikipedia.org/wiki/Metric_prefix) and [Binary prefixes](https://en.wikipedia.org/wiki/Binary_prefix) and
290
308
automatically generates according units. If you want to
291
309
add specifics (like different surfaces) you need to create an entry for that
292
310
prefixes version on its own.
293
311
294
312
All fields are case sensitive.
295
313
296
-
Contributing
297
-
------------
314
+
### Contributing
315
+
298
316
`dev` build:
299
317
300
318
[](https://travis-ci.com/nielstron/quantulum3)
@@ -311,8 +329,8 @@ If you'd like to contribute follow these steps:
311
329
(Optional, will be done automatically after pushing)
312
330
8. Create a Pull Request when having commited and pushed your changes
313
331
314
-
Language support
315
-
----------------
332
+
### Language support
333
+
316
334
[](https://travis-ci.com/nielstron/quantulum3)
0 commit comments