mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-31 16:07:41 +03:00 
			
		
		
		
	Merge branch 'master' into spacy.io
This commit is contained in:
		
						commit
						05ce97dbf0
					
				|  | @ -45,6 +45,14 @@ export function isString(obj) { | |||
|     return typeof obj === 'string' || obj instanceof String | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * @param obj - The object to check. | ||||
|  * @returns {boolean} - Whether the object is empty. | ||||
|  */ | ||||
| export function isEmptyObj(obj) { | ||||
|     return Object.entries(obj).length === 0 && obj.constructor === Object | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * Convert raw HTML to React elements | ||||
|  * @param {string} html - The HTML markup to convert. | ||||
|  |  | |||
|  | @ -15,7 +15,8 @@ import Link from '../components/link' | |||
| import Grid from '../components/grid' | ||||
| import Infobox from '../components/infobox' | ||||
| import Accordion from '../components/accordion' | ||||
| import { join, arrayToObj, abbrNum, markdownToReact, isString } from '../components/util' | ||||
| import { join, arrayToObj, abbrNum, markdownToReact } from '../components/util' | ||||
| import { isString, isEmptyObj } from '../components/util' | ||||
| 
 | ||||
| const MODEL_META = { | ||||
|     core: 'Vocabulary, syntax, entities, vectors', | ||||
|  | @ -105,7 +106,7 @@ function formatModelMeta(data) { | |||
|         author: data.author, | ||||
|         url: data.url, | ||||
|         license: data.license, | ||||
|         labels: data.labels, | ||||
|         labels: isEmptyObj(data.labels) ? null : data.labels, | ||||
|         vectors: formatVectors(data.vectors), | ||||
|         accuracy: formatAccuracy(data.accuracy), | ||||
|     } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user